@dlo98 …sounds like an overheating issue. when it turns of, does it beep or show a red light? if so, its recognizing overheating. if not, it still sounds like a component heating up and shorting the system out. can do some troubleshooting here:
this is a teardown of the system. follow this until you have access to the fan and housing. (and the apu as for the next step) make sure to clear any debris and clogs.
[guide|19493]
next clean and replace thermal compound. follow this guide here (applies to most systems. be sure to only apply compound where compound already exists):
[guide|744]
if it is due to components heating up and shorting, the apu is usually the culprit. follow this guide to fix:
[guide|55599]
these solutions should clear this issue up, in the case it doesnt…post back for further assistance.