How can I change the time before the system locks?

On Ubuntu 10 running Gnome:

System -> Preferences -> Screensaver. There's a checkbox to lock after the screensaver activates, and there's checkbox and a slider to activate the screensaver after a certain amount of time.


On Fedora Core 18 (Gnome)

Using the GUI tools:

Applications > System Tools > System Settings > Brightness & Lock

From the terminal (to set sleep timeout to 10 minutes / 600 seconds, then require login after 15 minutes / 900 seconds):

gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac 600
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-battery 600
gsettings set org.gnome.desktop.session idle-delay 600
gsettings set org.gnome.desktop.screensaver idle-activation-enabled 'true'
gsettings set org.gnome.desktop.screensaver lock-enabled 'true'
gsettings set org.gnome.desktop.screensaver lock-delay 900

On Debian 8 (jessie) it's in "Settings/Privacy". (press Alt-F1 and type "settings"). To run it from somewhere else, name of the application is "gnome-control-center".