Check if your cooling system (or your cpu fan) is working properly. In my old PC, i had that problem where mine was worse. My PC just turned off after using it for 5- 10 min. And i found out that my cpu fan was not correctly attached to the cpu. (intel stock fans are sometimes like that, the pinned ends)