I will be discussing the KDE and Gnome graphical desktop environments.
First it is a good idea to drop into the command line so hit ctrl+alt+f2. Then make sure you can actually log into your account from the command line. If that was your problem then it is easy to get your root user to reset it. If not keep reading.
Next try this command and record any error messages:
Try to do whatever the error messages said to do. If none of that works keep reading.
The first time I experienced this was when my /tmp directory had the wrong permissions. KDE does not give you any error messages at all. Gnome gives you this very obscure error message but at least it is an error message

.
Code:
/usr/libexec/gconf-sanity-check-2 exited with status 256
Verify that /tmp has the correct permissions. The permissions should be the same as what you see below.
Code:
ls -l /
drwxrwxrwt. 300 root root 16384 Aug 10 17:49 tmp
If the permissions are wrong do this as root.
If that was the problem then you should be able to log in as root

.