Why your laptop or desktop computer shutdown after booting or after some minutes might be because of the following reasons.
1: PRECESSOR: the system processor if damaged can cause the system to shutdown on its own which can be frustrating. Endeavor to change is ASAP so as to avoid further damage.
2: VGA: known as Video Graphics Array enables the system to display and also sometimes determine the quality of the system display. A problem with the VGA is a problem to the system.
Give the laptop to a professional to do the needful, but a simple heating of the VGA will do the trick. you will see the way a VGA looks on the post photo, it is usually covered by the heat zinc.
3: OVER HEATING: this is when a system gets too hot that it needs to shut down to catch a break.