I am pretty sure this is not a power supply issue.
There is a very strong chance it is an OVERHEAT issue
My first step being the easiest would be to take off the side of the computer after disconnecting it to check for dust build up in and around the cooling fan and power supply.
This is easily fixed with a can of compressed air meant for cleaning computers and just requires that you take it outside and blow it all out whilst wearing glasses and without poking the nozzle into anything.
Ram slot problems are quite rare nowadays but it may not harm to just remove it and blow out the slots and then put it back in.
Check that any extra cards are also seated fully as this can happen esp. if the computer was moved or leads were pulled that connect to them.
Computer are designed nowadays to shut themselves down if there is a problem.
What you should do is check the fan assembly and if it is loose at all that would give good reason to do what I am going to advise.
Disconnect the fan from the board.
Check your manual for the exact instructions but you should remove the cooler completely
DO NOT REMOVE THE CPU
Now with nothing more than isopropynol and cotton bud sticks or another alcohol based cleaner remove the old thermal grease / sticker from the top of the CPU (make sure it is clean)
At this point it is up to you but you could consider a newer better cooler
You could take your old cooler to a good computer shop show them it and just ask for a better one
If you are using your original cooler then here we go
Do the same with the underside of the cooler.
While the cooler is off it may be worth giving it a good 8low job
.
Now apply some new thermal grease (most computer shops have it)
Be careful about how much you put on
Here are
some basic instructions
Once you have re-assembled your cooler and re-connected it check everything is OK and power up the computer.
If everything went to plan you should now be back in business.
Another consideration is that many cases have places in them for extra fans and usually extra connections on the motherboard too.
They are quick and easy to fit.
Quite often I will fit TWO in what is called a push/pull configuration. One pulls cool air in while the other pushes hot air out