So this happened to me twice and when i was gaming. PC turned off while i was playing and i could restart it back. I had to wait 2-3 mins before the power button turned the pc back on. I'm not sure if the psu is dying or i am having too much load on the psu. Using a 850watts power supply.
Try grabbing OCCT and running the PSU stress test. I have this as an issue on one of my rigs, but it's only on start up, something to do with the unstable power grid in my area.
I ran the test and saw no problem while doing it.I monitored the temperature while playing and the average was 55c and max 60c. I was able to play the witcher 3 for about 2hrs before the pc shutdown again. After it shuts down the only way i can restart is if i turn off/on the switch to the power strip, it wont turn on if i don't do this.
I did switching to another socket, still happened. I have other things plugged in the same power strip(monitor, modem) and they don't turn off when the pc turns off. Also i noticed the pc trys to immediately restart it self but fails.
I would still try plugging the pc directly into the wall.
If it still happens it's most likely the psu.
If it's not the psu, I would guess the motherboard (mainly because I once had a bad asrock board which wasn't fun) but I doubt it would be causing you the issue.
Just tried plugging it in directly into the socket, started a game up and 5 mins in turns off. I guess it a PSU problem. Temps look normal, did some tests on the ram yesterday and everything is working as it should be expect the PSU. I'll submit a ticket and get the PSU replaced.
Thanks for the help guys. I'll update you guys when if there are still any problems when i get the new PSU.