Most often, delayed resets or shutdowns are caused by heat, overheating actually. But, there are other possible issues as well. Have you been able to determine whether or not it is the software shutting the hardware down or the hardware crashing, shutting the software down? Check your Event Viewer and see if any software issues coincide with the times your system has reset or shutdown. Open your PC case up and see if you have hardware that is really hot. Download CPU-Z and monitor the system temps. Maybe service the CPU by removing the fan or waterblock and verifying that there is enough thermal paste applied. It should just be a very thin coat between the two surfaces. Make sure your memory is properly seated. And lastly, if you've tried everything else, try resetting your BIOS to default.