Thank you, thank you, thank you!
IMAP push keep-alives (in global app settings) is how often the app does a quick refresh of IMAP IDLE connections, to prevent them from being disconnected by the network equipment between your phone and the mail servers, and/or by WiFi power saving compatibility issues in recent Android versions. A 10-minute interval is usually enough (and is the default).
The session duration is how often the app does a full refresh, logging out, refreshing, and re-establishing a new server connection. This one depends on the server, one hour (the default) is usually good, some servers allow IDLE connections to exist longer, some disconnect after a shorter period of time.