most likely a heat problem. This could be caused by dirt and dust inside the case or covering the heat sinks or by deteriorated thermal paste between the CPU and its heat sink. It can also happen because the various fans (such as the fan on the power supply, the graphics card or the fan on the CPU) are no longer working.
This can be solved by locating and correcting the problem and a heat problem can usually be verified by removing the side of the computer's case and directing a floor fan across the case's contents (motherboard and attached components such as graphics card, modem, NIC, RAM and yes, even the hard drive and power supply.
If the floor fan enables the pc to remain on start cleaning and replacing or just clean it up then leave the fan where it is and use the pc with the case open if money to replace worn components is an issue. (I have an old system with dual 450 Mhz CPUs and two very hot running SCSI hard drives that I keep running simply because I still use an old orphaned legacy app installed on it - its two CPU fans completely quit working years ago but the floor fan keeps the whole system cool enough that there is never a problem.)