Validity Period of the Login
How long a login should be valid can be defined in Keycloak for each realm individually. This is done via the Realm Settings > Tokens (see https://www.keycloak.org/docs/latest/server_admin/index.html#_timeouts).
The recommended settings are:
SSO Session Idle: 5 days
SSO Session Max: 30 days