You need to investigate the causative failiure. Next time you end up in text mode, hit ctrl+alt+F8. That should show you some of the messages from the boot process. If you don't see anything there, check the logs for error messages.
There might be a more appropriate log to check I don't know.
cat /var/log/messages | grep error
Another thing to try after logging in in text mode (instead of rebooting) would be
that latter command should start gdm and xorg, or at least offer some helpful failiure messages.
sudo /etc/init.d/gdm start && startx
I'm thinking it could be a hardware problem.