Also there is a possibility to set this parameter directly to database, just put a value under path
admin/security/session_lifetime
in the table core_config_data
Update
Magento 2.1 admin cookie life time = Stores > Settings > Configuration
Advanced > Admin > Security > Admin Session Lifetime (seconds) or till the user closes the browser
Since Magento 2.1 introduces lifetime for admin cookie as "expires on browser close", together with value in Stores >Settings > Configuration > Advanced > Admin > Security > Admin Session Lifetime (seconds). That means, that session life time equals value in Stores > Settings > Configuration > Advanced > Admin > Security > Admin Session Lifetime (seconds) or when a browser is closed.
Or you can set up a new value for admin cookie, like it is proposed in fschmengler's answer
For Customer Session
Please check this magento user guide related to customer session
Best Answer
To increase session to time for Admin , you need to go :
Stores -> Configuration -> Advanced -> Admin -> Security -> Admin Session Lifetime (it must be in seconds).
Uncheckd use System value option and add your value in textbox.
Minimumm second is 60 and Maximum is 31536000 (for one year).
Refer below screenshot for more details.