If you happen to love writing like I do, you tend to hear this term thrown around every once in a while. Mostly about characters created for fanfiction, but it can also apply to literature that stands on its own. Not everyone knows what it means, so I'll do a little clarification.
When most people hear the term, they think of a peppy, annoyingly snarky girl with oddly-colored hair and a contrived name who is impossibly hot, possesses an innumerable amount of magical powers, and really can do no wrong and has no weakness. And in some cases, this trope is correct. In reality however, ANY kind of character can be a Mary-Sue. It depends on how the character is portrayed by the author.
Here are some examples. I'm going to use my character Sawyer Stone from one of my stories as a healthy example of a character, and a character I just made up named Anthy Silverbell for the Mary-Sue. She's already off to a bad start due to her having that name of hers, but let's continue.
I'm going to describe their appearance in a short paragraph. Here is Sawyer:
"Sawyer Stone is a twenty-two year old woman, and she has long red hair that she likes to wear up in a ponytail or bun most of the time; she works quite a bit, and doesn't want it getting in her way. She has dark green eyes that are expressive and animated; it is usually easy to tell what she is thinking by looking at them. She has freckles adorning her cheeks and a few splashed across her nose, a trait she inherited from her father of Irish descent. She smiles most of the time, because she likes to show the world her good side, but inside she is uncertain, and uneasy about her future."
Now, here is Anthy:
"Anthy Silverbell is seventeen, but she could easily be mistaken for someone much older because of her phenomenal beauty. She has the most gorgeous green hair that anyone could ever lay eyes on, cascading like a beautiful waterfall past her waist. Her eyes are the bluest blue, sparkling like twin sapphires beneath long, sooty lashes. Her face is nothing short of perfect, completely flawless in every way, right down to her perfectly white teeth and naturally rosy lips."
You could spot the Mary-Sue pretty easily there, couldn't you? In Sawyer's description, we not only learn what she looks like, we learn more about her as well; important facets of her personality and background. In Anthy's description, it pays too much attention to how lovely she is, and tells us nothing about her character. Of course, there's nothing wrong with another character saying or thinking all this...to some degree. However, since the writer themselves is describing her, it makes her ripe for Mary-Sue material.
Let's see how they'd do in a stressful situation. Sawyer is pretty much an average human being, but she does have some skill with pistols, a skill she picked up from her father who was a policeman and wanted to teach her a way to defend herself once she came into the real world. Anthy possesses magical powers that are elemental in nature that she was mysteriously born with, and she can create and control any element she wishes at a whim, on top of being unnaturally strong, fast, and able to read her attacker's movements before they even attack.
Let's say they walk down a dark street one night and encounter a mugger, who brandishes a knife at them. We'll start with Sawyer first.
"Give me the purse, lady, and I won't cut that pretty throat of yours."
Sawyer is absolutely terrified, staring in silent shock like a deer caught in the headlights of an oncoming truck, having never been in a situation like this before. But years ago, her father had prepared her for something like this, and she never forgot what he told her--"Always assume there are bad people out there, and always carry a gun." However, her gun is in her purse; exactly what this man with the deadly weapon wants, and is gesticulating excitedly at. One wrong move and he could kill her in an instant. But she has to do something; she can't just give up what little money she has to this scumbag. Her hand plunges into her purse as terror flares in her heart for a moment: What if she can't find it? The man lunges forward, the knife gleaming dangerously. But her hand closes around the handle, relief washes over her in a wave, and she pulls it on him. The man is stunned, obviously not expecting to encounter someone armed, and he freezes. Sawyer sees the tables have turned, and she feels a bit more confident, but she's still trembling in a mixture of exhilaration and fear. "G-Go away!" she says as sternly as she can muster. "Leave me alone! Or so help me, I'll shoot you!" The man begins to backpedal, his hands up in the air, and he turns and sprints into the darkness, leaving her be. Sawyer lets out a long, shuddering breath of relief, her heart thudding wildly in her chest. "Thank you, Daddy," she whispers to herself with a slight smile, and puts the gun safely back into her purse.
Whew! That was a close one! Now, let's see how Anthy handles the same situation.
"Gimme the purse, lady, and I won't cut that pretty throat of yours."
Anthy stares at the man with her lovely blue eyes, shining like beacons to Heaven itself in the darkness. "Please," she tells him, her voice sounding like the most beautiful music mortal ears have ever heard, "I don't want to hurt you. Just leave now...or I promise you will be sorry." The man scoffs at her despite her absolutely stunning appearance. Obviously he is a loathsome creature who wouldn't know something beautiful if it slapped him in the face. "You, hurt me? That's a laugh. How about I show you what pain really is?" He lunges for her, the knife gleaming dangerously. But Anthy knew he was going to do that, for she can foresee any attack that might befall her. Leaping with the grace of an antelope and the speed of a cheetah, she dodges his attack flawlessly, causing him to fall flat on his face onto the pavement. Effortlessly, she creates water out of thin air and drenches him in it to add insult to injury. She giggles at her handiwork, her laugh causing her large and incredibly supple breasts to bounce pleasingly, tossing her head of long beautiful green hair over her slender shoulders. There was no one in this wide world who could possibly get a jump on her ever, least of all a silly, stupid mugger like this one. "Looks like you're all wet, mister," she titters, and begins to walk away, swaying her comely and shapely form as she does so.
Huh....well. That was...interesting. Was anyone else incredibly annoyed there?
For one thing, there was a total lack of any dramatic tension. There was no doubt whatsoever that Anthy was going to come out on top. It kind of ruined the suspense there, didn't it?
Also, the phrase that comes to mind for that paragraph is "Yes, we get it." Yes, we get that she's attractive. You don't have to keep reminding us. It's a sure sign that the character is a Mary-Sue; the author is constantly glorifying them with unnecessary descriptions. And it doesn't have to be beauty in particular; if the author goes on and on about how badass, how moral, or even how psychotic they are (if the writer considers that a positive trait), they're overly worshipping that character, and they're a Mary-Sue. Even if the other characters describe them in this way too much, they're in danger of being a Mary-Sue. Show, don't tell. We can figure it out for ourselves. That's not to say you should avoid describing your character all together; they'll be flat and boring in that case. Just remember that sometimes subtlety is more important than your ego.
Anyway, a good portrayal of your character is essential. I just thought I'd give some helpful advice!