Either the power supply as above or it's overheating. If it works for a while on safe mode then it's possibly a virus. Run a program like combofix or malwarebytes (or both) and see what happens.
Overheating perhaps. Computers in the lab here would randomly shut off for that reason. Just take it to a shop or you'll be looking at it on your own forever