There are four primary causes for a system to shut down under more intensive loads -
Overheating (fans running slow or even not at all - heatsinks bunged up with dirt and fluff)
Lack of power (power supply of marginal capacity)
Driver issues (particularly graphics card drivers)
RAM (poor quality or marginally performing)
What you could try is stopping it from shutting down on errors. Go to the Control Panel - System - Advanced tab - Click Settings in the Start up and Recovery section - untick the box Restart on Error. This may make the system give a BSOD from which some reason fort he shutdown may be gleaned.
When you restart, go into the BIOS and check the temperatures.
Check all the heatsinks (and fan speeds in the BIOS where possible) - clean if necessary.
Check the PSU wattage - at least 400W on this type of system.
Run a RAM diagnostic - put ram diagnostic into a google search and try a couple of the free ones.