How soon does it turn off? If it's very soon after starting the game, I'd suggest the power supply. If it's after playing for a while, I'd figure either the power supply or could very well be heat.
Why not get something like hwmonitor (http://www.cpuid.com/hwmonitor.php) and check your temps. See what it's like before playing the game, and if possible, start the game then ALT-TAB back to the program and see how it's doing after a few minutes.
Tell us what RAM, system, CPU, power supply and motherboard you have. After that we can proceed a bit further. Check your temperatures at Everest Ultimate Edition and give us either print screen or write eveything you see on there. You can download it from here: http://download.cnet.com/Everest-Ultimate-Edition/3000-2086_4-10499291.html
Did you vacuum your PC recently? Open up your case and with a small brush clean your computer inside, between radiators, fans. Everything. What cooling on your processor you've got? Standard or did you change it to something better? Give me as much details as possible please.
Randomly shutting off in games? power supply problem. components draw more power under load and it is obviously maxing out the PSU (most likely 12v amperage) and shutting down to prevent overloading/damage. I had this exact same problem.
@Analizer
i havent vacuum my comp in a while and i using stander cooling also is not the first time it happen when i first build it it did the samething when i installing a OS
Randomly shutting off in games? power supply problem. components draw more power under load and it is obviously maxing out the PSU (most likely 12v amperage) and shutting down to prevent overloading/damage. I had this exact same problem.
Unfortunately, no. if you have more than one HDD one more than one DVD drive try removing all so that you have one HDD (with your copy of windows) and one DVD drive. HDD's and DVD drives use a small amount of 12v amperage, but if you have, say, 2x HDD's and 2x DVD drives it will use maybe 5 amps.
Look at the sticker on your PSU, it should list the ratings. tell us what the 12v amperage and wattage is.
It can be a power supply OR processor problem. Both can get too hot and switch off in more "extreme" conditions. Such as playing games. Clean your fans inside your PC and check after.