In a tabletop RPG, the game master or equivalent (the person running the game) will generally act/speak the parts of all NPCs. These NPCs can range anywhere from an innkeeper the players talk to in order to rent a room to the mysterious woman who follows your party along for her own unknown reasons only to backstab you right when you were starting to trust her. It's up to the GM.
In LARP, the people running the game will again play the NPC parts, and may enlist others to be NPCs. In an ongoing game, LARP NPCs tend to be the characters who are either too temporary or too important to be done by a given player.
In single-player video game RPGs, NPCs are anyone who isn't your party. They generally aren't referred to as such in this context because "the guy next to the weapon shop" works just as well. These NPCs have a set dialog, and most will repeat the same thing they say every time you try to talk to them. Several webcomics have poked fun at this.
And in a MMORPG, the NPCs are the characters controlled by the server. They often have some kind of distinguishing feature, such as listing their trade in their status window or their name being displayed in a different color of text. As with single-player RPGs, these NPCs will tend to have set patterns of behavior and often must be interacted with to achieve some objective or another.
Talk to the NPC by the gates to start the item collecting quest.
-Responding to all questions with rote, scripted dialogue, whether it applies to the current situation or not.
-Attempting to continue with a procedure, even though it has become quite clear that a required piece of equipment is obviously not functioning, or absent.
-Generally refusing to recognize that the stimulus of their NPC behavior is a human being, and not another NPC.
Alternatively, an NPC is any automated phone answering system that attempts to do anything but connect you with the party to whom you most need to speak.
2. Customer: Hi, can I get a diet coke and 6 orders of french fries?
NPC: Would you like fries with that?
Fits perfectly with the common definition of NPC as "Non-Player Character" as the lawmakers in the NPC are government (computer?) controlled and not accountable to the Chinese people.