How often does this happen, and what are you doing during it's occurance. It can be due to many different things, but one of the first things i might suggest is run a virus scan.
It could be
___________
1. A program downloaded that your computer doesn't like;
2. An antivirus misdetecting something and causing your computer to lock down (which i highly doubt)
3. As previously stated, your PC overheating
The first thing i suggest you do is run a virus scan, it's practically harmless, requires almost no effort, and gets rid of 70% of your problems. (made-up statistic). If nothing is detected, you might want to consider leaving your PC on, less. If on too long, your computer will freak out.
Worst case scenario, i reccomend you format your harddrive, if it becomes too much of a hastle.
Again, this is information just spat out, with no description of your problem.