This could be caused by a number of factors. A power supply going bad, interruption of electrical power, incorrect power saving settings, etc. Please provide the hardware specifications and what OS and other software that is running when this happens. Does it totally shut off and requires a hard re-start(pushing the power button) or does it re-boot on it's own. Please be a bit more descriptive of what the comp. is doing, it will help to understand what is going on. Thanks
Along with what DogSnake asked, we also need to know the complete specifications - what hardware and operating system (yes, this is a Win7 forum, but you could have posted in the wrong place) - of your system.
You say shut down. Do you mean that the system turns off, blue screens, or does a reset and reboot?
Under what conditions? If only during gaming, what games?
Did this problem just start?
We cannot make house calls, so we need to know all that you can tell us.
Now, based on what you have told us, if the problem only happens when you play 3D games and the result is a reset/reboot cycle, my first guess would be inadequate power from the PSU. That is one reason for needing to know your hardware.