When you close your laptop lid, Windows can shut down, do nothing, or enter a power-saving state, such as sleep or hibernation. You can apply the same setting to all of your power plans or you can apply different settings to individual plans.
Open Power Options by clicking the Start button , clicking Control Panel, clicking System and Security, and then clicking Power Options.
On the Select a power plan page, click Choose what closing the lid does.
On the Define power buttons and turn on password protection page, next to When I close the lid, choose what you want your laptop to do, both for when it's running on battery and when it's plugged in.
To save battery power and quickly resume working, select Sleep. Sleep is a power-saving state that allows a computer to quickly resume full power operation (typically within several seconds) when you want to start working again.
Click Save changes.
On the Select a power plan page, click Change plan settings for the plan that you want to change.
On the Change settings for the plan page, click Change advanced power settings.
On the Advanced settings tab, expand Power buttons and lid, expand Lid close action, choose what you want your laptop to do when you close the lid, both for when it's running on battery and when it's plugged in, and then click OK.