First thing to check is make sure your fans are free of dust and also your output vents. Let us know what your max temperature is and what CPU you have. Like Kitkat said there are lots of causes that will restart your PC but most common is overheating.