A keylogger is a piece of software which records keystrokes, unbeknownst to the user. It is a kind of spyware.
Since keyloggers record all keystrokes, they can be used to steal the passwords of the workstation's users. This means that you must be particularly vigilant when you use a publicly accessible computer (like a freely accessible terminal in a place of business, school, or public place like an Internet cafe).
Keyloggers may be either software or hardware. For software, it may be a hidden process (or one with a name that looks a lot like the name of a real system process), which enters the information gathered into a hidden file. Keyloggers can also be hardware, in which case it's a device (cable or dongle) placed in between the computer's keyboard plug and the keyboard.
The best way to protect yourself from keyloggers is vigilance: