A role playing game is one which involves the portrayal of a character as an integral part. This character is usually involved in a milieu, from which a story will develop, usually with the player character (PC) serving as the hero. The milieu is the game setting, which typically includes enough detail to create a setting, including time, place, sociopolitical details, and non-player characters (NPCs).
Live action RPGs are the closest to actual play acting. They are akin to the dramatic school of improv, except that there is very much a rule system, including concepts of winning and losing, or at least progressing.
Pen and paper RPGs are exemplified by Dungeons&Dragons, not the first, but the most impactful game of its kind, invented by Gary_Gygax?.
Computer RPGs are in some ways not RPGs at all, owing to the limitations of the medium to allow for characterization. Most computer RPGs are action/adventure games which include a large number of items in the world, which the player can manage as part of his character's inventory, and some sort of complex rule system for simulating combat and avatar skill advancement, usually closely mimicking a rule system from pen and paper. Computer RPGs were invented as a sort of replacement for pen and paper RPGs, allowing single player games. The game serves as a kind of game master in a box, so to speak.
As mentioned, the pleasure derived from RPGs is a combination of taking part in a virtual world, or milieu, and presenting a character. The milieu is managed by the game master or masters, whose job it is to portray the NPCs, characters which players do not portray, for any number of reasons -- frequently evil, mundane, and/or sub-human characters, or even completely non-human beings which would be difficult or impossible or tedious to role play. In addition, you can only have so many heroes, but you usually need many secondary characters and extras, and it is up to the game master to decide how these NPCs behave. In addition, a milieu will frequently include a historical (or pseudo-historical) setting, such as the middle ages, World War II, or some other age real or imagined, like the future, Middle Earth or the like. The more fantastical, the more work is usually expected of the game master in crafting a fictitious history in which to situate the action of the game.
An RPG needs more than a historical setting. The milieu is usually completed with the addition of some specific recent events and some motivated NPCs who make demands or requests of the PCs to stimulate them into action. At this point, the story elements will run very close to the classic story elements of fiction. The WWW has numerous pages addressing these story types. Check the Google directory under Games.
Finally, the primary interactions of a player in an RPG are had through his character, also called his avatar. This involves two main efforts on the player's part: determining the character's actions as best possible to stay "in character", and at the same time doing her utmost to keep said character on a track of progress, measured by their standing in the world as a member of society and an example of (invariably) combat skill. The RPG itself will include a system of rules to manage the latter in an objective way, and often includes such characteristics as attributes, class, level, special skills, hit points, and experience points.
See sub-pages for deeper discussions.