If its turning OFF (not crashing) then it could potentially be several things, but its probably not overheating (unless the heatsink has literally and no longer has contact with the CPU). Bad memory also will usually throw a BSOD error, not a system power-off, but I suppose it doesn't hurt to check. It only takes about 20-30 minutes to do 1 pass, and that will reveal most issues that RAM might have. The problem is if your computer powers off during the test it will be hard to say if it was BECAUSE of the test or not ...
I've had such issues a few times, and usually it one of these 2 problems:
- A defective PSU
- An electrical short of some sort, fault in a wire or bad contact
The defective PSU issue is real easy to test for ... assuming you have a spare PSU you can test with - or (more likely) another PC you can temporarily "loan" a PSU from to verify that the PSU is the issue. Just be careful that you don't use a woefully underpowered PSU for your system setup when you run with a "loaner".
Finding an electrical short, bad wire or bad contact can be a frustrating and meticulous process, but first try to verify that it IS a short or wire fault of some sort (and that's usually easier). If it is then it usually responds to movement - so just run your system and give your case a few gentle slaps. Very gently flex your motherboard. Wiggle the wires coming from the PSU around a bit.
(in fact I just last week had just this sort of issue and it turned out to be a wire-fault in one of the PSUs wires going to the main motherboard power). I've also seen people install more spacers than they needed in their motherboards and thus shorting them at the back.
If none of this helps or seems relevant to you - does the problem appear while doing something spesific (low load, high load, games only ect.), or does it seem completely random?
-Stigma