Kind of. If you're REALLY curious, people often think that a Mary Sue is the author's self-insert, but it's not necessary for them to be. It just comes across that way because, essentially, too many GOOD things happen to the character, and not enough (or not ANY) BAD things.
A Mary Sue is a character who is treated by the narrative as almost completely untouchable and unbeatable.
Their analysis of a situation is always correct, even if it sounds like total bullshit and other members in the cast are offering far more reasonable interpretations (think Dr. House).
Whenever bad things happen to them, it's either very limited in significance, or the effects are only temporary. This includes DYING, which is why people often assume a Mary-Sue is the author's self-insert. It at LEAST demonstrates an unmistakable favoritism. (think Zero from the MegaMan series, and how many times HE'S died and come back)
And finally, and most noticably, the Mary-Sue character is often simply more effective than everyone else in the story at doing what needs to be done. In stories that involve a lot of detective work, they'll be the smartest one and figure out the badguy's true identity before everyone else even has a clue. In stories with a lot of fighting they'll have an incredibly busted powerset or just be much stronger than any other hero (think Captain Marvel. The female one).
It's also especially telling if the character is specifically advertised as being better at doing X thing than "popular hero who is known for X thing" (think how Moon Girl is often advertised nowadays as being even smarter than Tony Stark and Reed Richards).
The problem with a Mary Sue is that they run into the issue of having no real flaws, and if they DO have flaws they are insignificant to the story.
The most important thing about Mary Sues is that they are almost always a mistake, and not intentional.
Writers will write such a character out of genuine reverence and narcissism, and be completely unaware of how such a character completely dilutes any tension in the story.
After all, how could evil possibly win when the goodguys have Mary Sue on their side? Well, you have to chain down the Mary Sue in ways that don't make sense for the way the character was established.
In other words, to create tension in a story with a Mary Sue, you have to be a bad writer, and write a bad story.