You might want to list out all the components (include model numbers).
Is this a brand new build, or has it been functioning properly for a while? Do you get any error messages for the shutdowns?
There a few suspects for random shutdowns: CPU overheating, bad PSUs and bad/improperly set RAM.
First, download Prime95 and RealTemp (links in Step 10 of the "Step-by-Step Guide to Building a PC" sticky). Run them together for over an hour. Come back with the temperatures you get.
Next, download MemTest86+ from memtest.org. Burn the ISO file to a CD. Then look up the manufacturer's specs on the exact sticks of RAM. Next, restart the computer and enter BIOS. Make sure the RAM's voltages, timings and speeds are set to the specifications. Then set the computer to boot from the CD. Restart and let the machine run overnight. Come back with any results.