Method 1
Can you navigate to system recovery settings? If you don't know how follow these instructions :
Hold winkey+r
to bring up a Run box
Type sysdm.cpl
hit Enter
Select Advanced Tab
System StartUp and Recovery, Settings
Under system failure make sure Automatically Restart is NOT checked
Under dump file make sure it says %SystemRoot%\MEMORY.DMP
Select Ok then try your screen/sleep again.
Method 2
If this doesn't work and you laptop still restarts, follow the next steps:
Hold winkey+R
to bring up Run box
Type msconfig
hit Enter
On the General tab check Selective start up and uncheck Load start
up items
Now go into Services tab and select Hide Microsoft Services then
click Disable all
Select Ok and restart your computer.
Then try to enter sleep mode again by closing the lid.
Method 3
If you are still not having any luck, I would give this a try first and if it doesn't work then reset your power settings to Never sleep:
Open Command Prompt in Admin mode and type chkdsk /f/r
This will take a while to complete but let it run fully
You will be prompted that it cannot run this as it is currently
being used, would you like to run it on next start. Choose Y
Then restart your system.
See if your computer still restarts.