There are various causes for this issue. It's possible that one of your application is not compatible with the operating system installed or you have a problem with cooling. However, it's recommended to visit a laptop service repair shop to diagnose the problem. It's very likely possible that the fan is having problems and when it overheats, the laptop shuts down.