Check the power options on your PC. There is an option that controls what happens when you close the lid. Your is probably set to put the PC to sleep.
You have to go to the Control Panel to configure this. How you navigate to the option depends on what OS you have. I have Windows 7. For me it is:
Control Panel-->Hardware and Sound-->Power Options-->Choose what closing the lid does
There is a separate option based on if you are running on battery or plugged in.
EDIT: BTW, the options are Sleep, Hibernate, Shut Down, or Do nothing. I set the option to Do nothing.