If it's a software issue, such as unstable Windows, this is more likely simply to incur a "Blue Screen of Death" (BSOD), or simply a black screen if the settings are not to show a BSOD... and then reboot - so no powering off.
The powering off and then on again suggests that it is a heat issue. Most PCs these day are designed to power off if one of any number of components start to significantly overheat. So that would be where I would start looking.
For example, is the fan in the PSU working, or is the PSU itself very hot?
If you have any way of checking the temperature history of components, possibly through the BIOS (not sure if any store temp history, though), you can see if anything spiked prior to the power-down?
It may not be heat related, but that would be my initial guess.
If your computer is definitely not overheating, it may be that your BIOS has become corrupted and simply thinks that it is overheating.
There again, it may be something entirely different.
