U R MR GAY comes from a secret "Easter egg" on the Super Mario Galaxy box art.
On the box art for Super Mario Galaxy, people noticed twinkles on some of the letters. These being U, R, M, R, G, A, and Y. This of course spells out U R MR GAY. People then converted the U to You and the R to Are. This would spell out "You are Mr Gay". It is debated whether or not this was on purpose by Nintendo. It is most likely meant to be "U R MR HAPPY", since gay is another word for happy, as a way of saying thanks for buying the game.
In the sequel, Super Mario Galaxy 2, fans of the meme tried to identify a new message in the same way: checking letters with twinkles. The letters are U, R, M, I, A, and Y. This does not spell anything, but if read backwards it spells YA IM R U. This can be interpreted as "Yeah I'm (or I am). Are you?" Some say it also says "Y I AM! R U?" if read a certain way.
Super Mario Odyssey also includes sparkles on its letters, however it was place on all of them, possibly as a response to this meme.
However, it was popularized in the crib after members, mostly 20baisju, began using it to describe someone as . . . well gay. When said, its most commonly in the tone of the Easter Egg Hunter.