Many reasons are possbile.
It may be overheating and the sensors detect it so it shuts down to prevent hardware damage. If this is the cause, buy a can of compressed air and using the can upright spray in small blasts in the fan. You don't want to ruin the fans motor by holding the air release button too long cause it can be powerful blasts. If you tilt the can it could spray liquid which is not what you want so always keep the can upright.
If it is not a dust problem causing it to overheat, it could be a hardware problem starting to fail, there are many things that could be wrong and only a specialist could tell you specifically.
Could even be malware software shutting it down. Scan with Malwarebytes if you would like.