Hi, I'm Ethan and I'll be assisting you with your problems.
Most likely causes:
Your computer is under stress, so overheats.
Your computer is under extreme load, and is working overtime. The parts (especially CPU and GPU) are working so hard that they may be damaged. Your computer turns itself off so it isn't damaged.
If you could provide your system information, that would help me greatly. To check your system specs, press 'Windows key' + 'R' and then type 'dxdiag' and press 'Enter'. Post all the information in the first tab and in the 'Display' tab.