Theresa Nielsen Hayden has written an enormous blog post about the Mary Sue story. To quote the exact definition:
MARY SUE (n.): 1. A variety of story, first identified in the fan fiction community, but quickly recognized as occurring elsewhere, in which normal story values are grossly subordinated to inadequately transformed personal wish-fulfillment fantasies, often involving heroic or romantic interactions with the cast of characters of some popular entertainment. 2. A distinctive type of character appearing in these stories who represents an idealized version of the author. 3. A cluster of tendencies and characteristics commonly found in Mary Sue-type stories. 4. A body of literary theory, originally generated by the fanfic community, which has since spread to other fields (f.i., professional SF publishing) because it’s so darn useful. The act of committing Mary Sue-ism is sometimes referred to as “self-insertion.”
I thought this might be more related to games than it turned out to be. Oh well. Go read this comic. It's funny.