A keylogger is a program which is used to record every keystroke you make into a log file. It can be used to collect your personal information like your usernames, passwords, bank account information and other private data.
There are few unethical uses too like companies can use it to check whether their employees are doing there job or just surfing unproductive websites
It is advised to use this only for educational purposes.