A "Mary Sue" is a character too good to be true; someone who can do no wrong, fail no test, encounter no setbacks of any consequence. They're annoying, superficial, and if you're not careful, they can happen to you!
Whenever a character serves as an improved or idealized version of his or her author, as a vehicle for the author's fantasies of power, allure, virtue or accomplishment rather than as an integral part of the story, that character is a Mary Sue. He may resemble his creator in most respects, but he drives a hotter car, lives in a posher part of town and has a cooler job. She may be as moody and self-absorbed as the novelist who invented her, but instead of boring the people around her these traits only enhance her crazy-girl magnetism, making her the center of everybody else's world as well as her own.
Laura Miller at Salon gives advice on how to spot the Mary Sue and avoid it in your writing. Probably the first time I really encountered an annoying Mary Sue was in Bryce Courtenay's The Power of One, where the young boxing hero wins every match, can do no wrong, sees from the get-go the immorality of apartheid, etc. Once I realized the author had no intention of varying this theme, I gave up. Other famous Mary Sues include the heroes (yawn!) of Ayn Rand novels.
The best takedown of a Mary Sue that I've read (and one of the best skewerings of a bad book ever) comes from Jen McCreight at Blag Hag. This one is worth taking the time to read -- it's devastating, funny, and will make you keep a sharp eye on everything you write afterwards.
"Hello, Mary Sue...good-bye, art!"
P.S. Next, how to resist making absolutely horrible puns!
Pictured: Sierra, skeptical as ever unless you bring her food.