If I run a command which requires root privileges with sudo, I will be asked to enter the current user's password. After that for a while, if I execute the same sort of commands with sudo, I won't be asked for the password again. So my guess is that the password is cached somewhere until it expires. How long is this expiration time? Is it possible to configure it?
How long is the password for executing a command with sudo cached?
sudo;password;timestamps
man 5 sudoers informs us that there is an option timestamp_timeout:timestamp_timeoutNumber of minutes that can elapse before sudo   will ask for a passwd again.  The timeout may include a fractional                         component if minute granularity is insufficient, for example 2.5.  The default is 5.  Set this to 0 to  always                         prompt for a password.  If set to a value less than 0 the users time stamp will never expire.  This can be used                         to allow users to create or delete their own time stamps via sudo -v and sudo -k respectively.So yes, it can be configured via /etc/sudoers, and by default it expires after 5 minutes.