In videogames, NPC stands for Non-Player Character (a term which, I've been recently told, originated in the 1980's from Roleplaying games, such as D&D). That would mean anyone that's not being controlled by any of the players (and is not hostile towards them, but I could be mistaken).
Their general use is to fill spaces. Usually towns, parks or whichever place needs to be populated (depending on the game's contextual environment). Sometimes the player can talk to them and they respond and sometimes they're simply ornamental.
They can also be used as
- Clue and quest givers. In The Legend of Zelda game franchise, there are more than enough examples of this, although in the earliest games, some of he clues provided by the NPC's confused the players even more. They are the MMORPG's main way to obtain quests.
- Temporary companions. There are games in which characters controlled by the game's AI join your party and even help in combat. Alas not for the rest of the game. There are examples of this in at least one of the Final Fantasy games, Realms of Arkania: Blade of Destiny and many others.
- Comic relief. In some videogames the hero (or party of such), are too damn cool to attempt any funny schemes, so the humorous moments, if they exist, are delivered by npc's. The only example (and perhaps not a good one) of this that I can remember is from one of the Final Fantasy games, in which one npc yells: "You spoony bard!"
- Plot device. You find a girl in the forest and must escort her to safety, only to learn she's the princess of the realm and was escaping from a group of bandits, which you'll join because they were trying to save her from an evil demon who is impersonating her royal father; or a kid who happens to steal your wallet while you're on town and now must chase him, ending up at his hideout which results to be the remaining ruins of the ancient civilization you're coincidentally searching for.
There are possibly many other uses for the NPC's. These are the most common I've seen.
Videogames, mostly RPG's: The ones mentioned above.
20070823 - Correction, suggested by rootbeer277
20070827 - Adding information provided by StrawberryFrog