One possiblity for a solution is the following.
when you arrive at the log in screen rather than 'loggin in' drop to a terminal. Normally you can do this with the key combo (ie press the control key and any of the F keys).
You should get a login prompt.
Login in with your username and password.
you should now be able to start an X session with the
startx
command. If the login fails you can check the last few lines of the log file
tail -10 /var/log/Xorg.0.log
and post them here, in fact you probably want a copy if it works for comparison...keep reading.
Also whilst you are here maybe run a quick update, just to be sure
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -f
The final one will fix any broken packages, just in case you have other problems on your system
If however everything works out fine, then there is something else going on on your login from the window manager.
So you'll need to log off, and then get back to the log in manager screen using the < ctrl F* > key combo (it normaly resides on F8, but may be different on your machine.
Don't log off your terminal log on just for the moment, you are going to need it.
re log in from the graphical screen and wait for the login to fail.
Now hop back to your still open terminal and re-issue that tail command to look at the Xorg log info. I should tell you where things are failing.
If you need more lines increase the value you send to the tail command to get extra lines.
If you still have problems you will need to find a way to post the output of the tail command to your qestion... something such as.
tail -10 /var/log/Xorg.0.log > ~/desktopFromCLIWorks.txt
and
tail -10 /var/log/Xorg.0.log > ~/desktopFailsFromLoginScrn.txt
Finaly have you tried other desktops ? if you have them.
Also I just found this question here on Ask Ubuntu. where the OP used
sudo apt-get install --reinstall ubuntu-desktop
Clearly change ubuntu-desktop for the desktop that you are using. Again you'll need to run this from the CLI that you opened.
David