In most Windows laptops, when we close the lid the computer goes to sleep. This behavior can be changed in the power settings.
Open the Control Panel from the Start Menu.
Click on Power Options
Select the option
Choose what closing the lid does.
Here you can specify what closing the lid does. It is possible to specify different behavior for when the laptop running on batteries and when external power is available.