I would look at a heat issue...more than likely the CPU fan quit working or the thermal paste as failed or there is just too much dust mucking up the computer.
A Failed Power supply can cause this as well or a bad motherboard and a blown BIOS
1)If the CPU fan quits or slows way down there is an auto shut down to protect the CPU
2) If the thermal paste (some manufactures used thermal tape) gets too hard it looses it heat transfer capabilities and causes the CPU to overheat and shut down.
3) If the CPU heat sink is so clogged with dust and there is also blocked air flow this can cause the CPU to overheat and shut down.
4) The power supply may start up and immediately fail and cause a shut down as well.
5) About 4 or 5 years back there was an influx of bad motherboards being installed. These motherboards had some bad filter cans which caused them to expand and burn out. The filter cans tops were flat...if they are rounded then this is your problem.
6) a failed BIOS flashing can cause this action as well