It does help when posting if you say whether you have a desktop or a laptop and give the make and model or the main specs.
To deal with the shutting itself off problem. This sounds like you need to change the power settings in 'Control panel'. Follow these steps -
Press at the same time the 'Win Key + X'. This brings up a menu, click on 'Control panel' then, when it opens, click on 'Power options'. In the middle of the screen that appears you should see two main options - 'Balanced' and 'Power saver'. Normally 'Balanced' is the default and has a dot in the circle. To the right of this you should see 'Change plan settings', click on this. this is where it matters if it is a laptop or a desktop !
If it is a desktop you will only get the options 'Turn off the display' and 'Put the computer to sleep'. On my desktop I have these set to 20 Minutes and never respectivley. If yours are set very much shorter this would explain your problem.
If it is a laptop you get similar choices but two sets of them - 'On battery' and 'On mains' and three options for each - 'Dim display', 'Turn off display' and 'Put to sleep'. On battery I usually set laptops to 5 minutes, 10 minutes and 20 minutes and on mains to 5, 10 and never respectively.
Check these and post back if it it doesn't improve the situation.