I have been having this problem the past 2 days, and I still am at a loss. I have not changed anything hardware-side in my computer, so I don't think it's got to do with a crappy CPU or RAM or graphics card.I have had this computer, with its current setup, for many months, if not at least a year now, and this has never happened before.
Also, I don't think it's an overheating problem, as it would shut down instead of restart. I guess it wouldn't do any harm to clean it out, though I ran BurnIn Test and it showed no problems, and a steady CPU temeprature of 50-60 degrees celcius.
The drivers for the CPU and graphics card are the latest, and I have defragged the machine.
Lastly, I don't think it is the power supply either, as the computer can stay on for days on end without a problem, and only restarts when I'm playing certain games that have decent graphics, and this has never happened before.
EDIT: Computer details
OS: Windows 7 Home Premium 32bit
Processor: Intel Core i5 CPU 750 @ 2.67GHz 2.67GHz
RAM: 4 GB
Graphics Card: NVIDIA GeForce GTS 250
Hard Drive: 1 TB