There is an option named default-cache-ttl
that controls how long the agent will remember the password to the private key. However, when I put it in the config file it doesn't work - instead, gpg complains:
gpg: /home/jan/.gnupg/gpg.conf:8: invalid option
My version of GPG is
$ gpg2 --version
gpg (GnuPG) 2.1.11