I purchased my macbook back in 2011, and this problem just started. When I unplug and close my computer to put it in my backpack for school, it does not sleep. I take it out and its very hot and has lost a large amount of battery. My energy saver controls say it should sleep after 10 minutes of inactivity, but either way it should sleep when I close the lid. I don't have any sharing options checked or any running apps that should be keeping it awake so I have no idea what could be causing this
Have a look at this answer which indicates the commands to help you analyse if any process is blocking the sleep of your MacBook.
If nothing is blocking it, then look at :
egrep -i 'sleep|wake' /var/log/kernel.log
and look if you see a sleep line at the time you close the lid. If you don't, look at any information message in:
around the instant this event should have happened.
Create a test account, close your session, and open one with this test account. Is your MacBook entering sleep when you close the lid?
Fortunately, you can reinstall OSX without using a disk and its fairly quick. This fixed my issue
I have a MacBook Pro 13" A1278 (Mid-2010). I had the same problem. When I closed the lid, the screen remained on wouldn't shut off but I could manually put it to sleep from the Apple menu. Now keep in mind this all happened with no battery in the laptop. I just put in a new battery tonight and voila! Sleep mode works again!! I troubleshooted for hours. No more worrying about the power cable falling out.