Check your computer settings. All computers shut off after a while, even when they’re on AC. [br]
You’ll find a setting regarding Sleep Mode and Shut Down where you can change if your computer should shut down/go into Sleep Mode in X hours/minutes or never.
That usually fixes it, however if the computer goes into Sleep Mode while use it’s worrisome and the problem may be deeper.