It depends on the type of sleep mode set.
The first sleep mode, will shut down the system fully, except the ram and it will store all the current running in there until you wake it up from sleep mode. The drawback with this mode is obvious if you have a power cut during the night, then all the data is lost.
The other mode saves and image to the hard drive of the state the system, os was and any other programs running at the time, and then sends the rest of the computer into sleep mode clearing the memory. Then on power up reloading the saved running os and programs that were running from the image it made to the hard disk drive.