PC's shutting themselves off is often indicative of power issues...(borrow one if you can to eliminate an expense if unnecessary, just in case the existing PSU is in fact fine...) Assuming you are not overheating, where some systems' BIOS options can cause as actual shutdown as a response to thermal issues...; check HWMonitor to make sure CPU package/core temps are fine
I'd start with slaving in a new quality PSU of sufficient wattage....(all PSUs were 'working fine the day before' they started giving problems!)