By default, the admin session lifetime in Magento 2 is set to 900 seconds (15 minutes), and most of the time this is quite annoying. As this is a setting in the backend, we can change it quite easily.
To increase the lifetime of the admin session, you will need to go to:
Admin panel → Stores → Configuration → Advanced → Admin → Security → Admin Session Lifetime (seconds)
This is the field where you can increase the lifetime in seconds.
In my example, I have changed the lifetime to 24 hours = 86400 seconds
Please note that a logout and login would be useful for the new setting to take effect.