Ubuntu has an incomplete power management tool built in. Some of the things you CAN'T configure is the ability to sleep instead of hibernate when the computer is idle for a period of time (the period of time is easily configurable in the power-settings dialog). Here's how to modify Gnome's advanced power settings using the gconf-editor:
Run the command gconf-editor (press [alt]-[f2], type gconf-editor, and press [Enter])
Browse to /apps/gnome-power-manager/actions/critical_battery
Change the settings. Possible values are "hibernate", "suspend", "shutdown" and "nothing".