Hi,
A possible cause is your laptop may be overheating and doing an automatic sleep or may just need some reconfiguration. First disable sleep mode and observe the laptop if it will still go to sleep even you're not or using it.
- Right click on the battery icon on the bottom right hand corner and select Power Options
- On the left pane of Power Options click on Change when the computer sleeps and set it to Never or 0 and click on Save Settings.
- In the main Power Option screen click on Change plan settings depending on what plan is selected.
- Click on Advanced power settings and look for Sleep
- Change the following to "Never" (Sleep After, Allow Hybrid Sleep, Hibernate after)
- On Screensaver settings select None so it won't go to...