Why does my computer keep switching on?

You need to check what wakeup mechanisms you have configured.
Any on of them will push it out of sleep.

Check Fix for Windows 7 "random wake from sleep" problem.
It refers the powercfg tool,

powercfg -lastwake

will tell you what tripped it the last time...
But, do look at the rest of that posting too.


Cant add comments or vote yet, but nik is right. It often happens with wireless mouse/keyboard. They probably sends some signals from time to time to receiver or something like that. But what ever the

powercfg -lastwake

will tell you, you can disallow this device from waking your pc up in

device manager -> your device -> Power Management tab -> uncheck the Allow this device to wake the computer.

Edit: After reading the article from nik's post I recommend you do same :)