(A). An exclamation used to describe the speaker's congruence or approval of an action or a previously said phrase.
It is comparable to words like "okay" or "yeah". It is often used as a filler term.
(B). A phrase which subtly expresses the speaker's disinterest or dislike with a topic or situation at hand.
These are of very many definitions of this word.
(A)
Person A: When did you get your car again?
Person B: I got it about seven months ago.
Person A: Right.
(B)
Person C: You look awful today.
Person D: Right. Thanks.