A character too perfect for their setting. Most often, this character is talented and attractive, and anyone who doesn't adore them is portrayed as mean, stupid, or evil. It's common for them to be the smartest, even if this requires everyone else to act stupider than they should. Out of place but awesome names are also frequent occurrences. They lead charmed lives, and any conflict or drama they are met with will be either overdone to the point of headache induction, or easily brushed aside.
While not always the case, Mary Sues are more often written by someone who is just starting out, either by someone who wrote their own personal power fantasy and expects everyone else to applaud them for it, or by someone using shortcuts to try and make their character impressive to others.
These characters are considered a mark of poor writing because they give too much favoritism to the character in question, and it comes off to readers as the author trying to artificially make their character the best around through shortcuts rather than well crafted development. Their perfectness also tends to prevent the stories they're in from developing suspense, making not only the character but the entire work they're in boring.
While the term Mary Sue, along with the male version Gary Stu, has been applied to both fan characters and canon characters in published works, it is much more common to see used on fan characters. Particularly those in fan fiction, which are most often female.
So this girl's name is Crystal Roseblade, she grew up in the same orphanage as the protagonist and was a childhood friend of his, but he forgot about her, and now she's come back out of nowhere as a huge pop idol who's secretly the world's greatest demon slayer? Do you think you might be writing a Mary Sue?
The Urban Dictionary Mug
One side has the word, one side has the definition. Microwave and dishwasher safe. Lotsa space for your liquids.
Buy the mug