The word avatar originates in Hinduism, where it stands for the "descent" of a deity in a terrestrial form (deities in Hinduism are popularly thought to be formless and capable of manifesting themselves in any form).
The earliest use of the word avatar in a computer game was the 1979 PLATO role-playing game Avatar.
The use of the term avatar for the on-screen representation of the user was coined in 1985 by Richard Garriott for the computer game Ultima IV: Quest of the Avatar. In this game, Garriott desired the player's character to be his earth self manifested into the virtual world. Garriott did this because he wanted the real player to be responsible for the character's in game actions due to the ethical parables he designed into the story. Only if you were playing "yourself" Garriott felt, could you be judged based on your character's actions. Because of its ethically-nuanced, story-driven approach, he took the Hindu word associated with a deity's manifestation on earth in physical form, and applied it to a player manifesting in the game world.
The term avatar was also used in 1986 by Chip Morningstar in Lucasfilm's online role-playing game Habitat.
Another early use of the term was in the pen and paper role-playing game Shadowrun (1989).