This is a very good question that ties in to both the mechanics of different types of characters and their narrative role, and in addition to those, their role in the group. There is no clear boundary where an NPC becomes a GMPC, and hence I will be explaining the traits of a GMPC rather than try to define a boundary that doesn't exist. However, it will still give you a pretty good picture in broad strokes what a GMPC is like and how it differs from a normal NPC.
The narrative GMPC
The narrative side concerns the role of the PCs --- they almost universally are the protagonists of the story the players are playing. Protagonist means "main character", and they can be seen as the main actors and focal points of the unfolding story. A work can have many protagonists: eg. Gandalf, Aragorn and Frodo are all protagonists of The Lord of the Rings (and to a lesser degree, so are a variety of other characters!), and Woody and Buzz are the protagonists of Toy Story.
For contrast, NPCs are usually supporting characters that might have a big role in the events going on, but who are not focused on in a similar way. They might be antagonists (opponents of the protagonists) or supporting characters who reinforce the protagonists' story somehow.
A narrative GMPC is a character, played by the GM, who is a protagonist similar to the PCs, complete with comparable agency and personality to the other PCs. This is often seen as an issue since this means they also claim a share of the narrative focus --- while also serving as the chief director of the story. Care must be taken so the GMPC won't steal the show and turn the game into a novel written by the GM instead of a collaboratively told story.
The mechanical GMPC
The other side of GMPCs is more tied to particular game systems and depends on the mechanical distinction between PCs and NPCs. Some RPG systems make little or no mechanical difference between the two classes of characters: eg. Wild Cards of Savage Worlds work almost equivalently regardless of whether they're PCs or NPCs. They're built using the same rules and they follow the same rules with only minor alterations.
In the other extreme end, we have games like Apocalypse World where there are very few rules directly concerning NPCs. They cannot trigger moves themselves, only be affected by the moves triggered by PCs. In the middle of the spectrum, we have games like Dungeons and Dragons where NPCs follow the same basic mechanics as PCs but have simpler features that better suit their role in the game than a full-blown PC would.
From the mechanical standpoint, a GMPC is a character who is played by the GM but uses full or slightly altered PC mechanics. However, the term is usually not used for antagonists, as building enemies using the PC rules is fairly common in games like DnD (even if it's not always advised).
The "missing role" GMPC
The third axis of GMPC is the role in the group and ties in closely with the earlier two. Some games expect the PCs to form a group with a particular composition, or are commonly played as such by convention. This can result in a "role" needed for smooth gameplay experience being missing from the PCs created. The stereotypical example is missing a "Healer", which is necessary (or ostensibly so) for playing certain systems or scenarios. A GM can attempt to remedy the missing role without forcing anyone to switch their character by creating a new character to play the missing role instead.
Whether or not the Healer (or other "missing role") is referred to as a GMPC varies a bit. By my experience, if the character is mostly a tagger-along who has little purpose or personality outside their mechanical niche, they're more often referred to as "NPC Healer", "NPC Thief", "Henchman", "Bodyguard" or something similar. Some games (eg. Dungeon World) even have their distinct rules for this kind of followers, separate from both normal NPC and PC rules. Therefore, this ties back into the other two elements: whether the character is mechanically complex enough to be considered a "PC" and whether the character is focused on narratively enough to qualify as a protagonist.
In a nutshell
Is the character played by the GM...
- a significant enough focus in the story to be considered a protagonist?
- endowed with similar level of backstory and character development to the PCs?
- played using full or significant PC mechanics, in systems where they differ from NPC mechanics?
- mechanically fully present with the group, partaking in all or most challenges?
- built to conform to a particular role in the group that's usually reserved for a PC?
The more questions you answered "yes" to, the more soundly you are in GMPC territory.