A keylogger is a type of sypware installed on a computer.
It logs your keystrokes and transmits them via the internet. This kind of program is used to steal user credentials (username and password).
Keyloggers are usually hidden within files or software. So you should avoid installing software from an unfamiliar source, especially if it's from someone messaging you in the game.
Be especially cautious when using a computer that can be accessed by other users (e.g. a shared computer in a business, school, or public place such as an internet café), and when someone you don't know sends you a program or file – only download it if you're 100% sure there's no risk involved.