To control when your Mac goes to sleep and (if it's a laptop) how much power it uses, use the Energy Saver panel of System Preferences (Chapter 13).