1) a bluish or purplish coloration of a guy's ballbag caused by the settling of blood in the veins in the scrotum, and...
2) sensitivity in the groin area that can range from very erotic to extreme pain.
Blue balls result from repeated stimulation of one's cock for a period of time without getting to orgasm / ejaculation.
Examples include repeatedly jerking off up to the point where one needs to cum; repeatedly receiving head or getting hand jobs from a partner but not cumming. Seriously kissing and fooling around with a (str8 or gay) partner over an extended period of time.
1) I stroked my dick for three hours while watching porn and got blue balls till I hurt so bad I just had to jack off.
2) After a couple hours of deep kissing, playing with her tits, her sucking my cock and me finger-fucking her ass, I had blue balls bad. She looked at me, chuckled and said, "Let me suck you off so you get some relief."