You may experience the following issues on a desktop or a notebook computer that is running Windows 7 / 8 when you try to put the computer to sleep:
  • The computer wakes immediately after you put it to sleep.
  • The computer randomly or unexpectedly wakes after sleep.
  • The computer does not go to sleep. Instead, it stays awake.

Windows does not Sleep
To fix this problem, try the following methods in the order in which they are presented until you resolve the problem.
  • Update the drivers to the latest version.
  • Check the Power Option settings.
  • Prevent device(s) from waking the computer.

Nice detailed instructions at KB976877.

Go here if your Sleep Mode is not working in Windows 8.1!