If your device is disconnected from the computer and USB debugging is disabled, pressing the power button will make it sleep.
If you plugged it in by disabling USB debugging and turning off the background image, it will also wake it up as soon as you press the power button.
source share