How to:
Set your computer to go (or not to go) to sleep after a specified period of inactivity. For more information, seeTurn off a computer: frequently asked questions.
Adjust the brightness of your display.
Choose when to turn off the display during periods of inactivity.
Open Power Options by clicking the Start button, clicking Control Panel, clicking System and Security, and then clicking Power Options.
Under the plan that you want to change, click Change plan settings.
On the Change settings for the plan page, choose the display and sleep settings that you want to use when your computer is running on battery (if applicable) and when it's plugged in.
For more options, click “Change advanced power settings.”
When you’re done click OK.
src = https://answers.microsoft.com/en-us/windows/forum/windows_7-performance/how-do-i-stop-my-computer-from-going-to-sleep/c24555c0-3d73-e011-8dfc-68b599b31bf5?auth=1