Sudden shutdowns can be caused by overheating, motherboard issue, power supply issue as the most common things. Clean out the case and all fans, you may want to clean and re-install the CPU heatsink with new heat grease, if you have an add-on video card make sure that does not get too hot and check the fans on it if any. Look over the motherboard for any issues with the capacitors, they should be all flat and shiny, if any are puffy or have stuff coming out the tops, replace the motherboard.