Best hook for when a user session ends?

There is an auth_cookie_expired hook, but that’s only going to fire if the user visits the site with an expired cookie.

Sessions don’t “end” in the way you might be thinking. When users log in they get a session token with an expiration. When that expiration time passes, the token is no longer valid, but the token is only ever checked when the user visits the site. If the user logs in and then doesn’t visit for 2 weeks, nothing happens in WordPress to log that user out. It only means that when they finally revisit the site, their token will have expired and WordPress will then require them to log in to get a new token. This is when auth_cookie_expired is fired.

So that answers your question about a hook firing when a session ends (TL;DR, there isn’t one), but doesn’t solve your problem. Unfortunately your question doesn’t include enough information to be much help (it’s a bit of an XY Problem, to be honest), but my suggestion would be to record all logins but including the expiration date. Then when you need to count or display the active sessions, you’d only count the sessions with a date that hasn’t expired. You could couple that with the wp_logout and auth_cookie_expired hooks to completely remove sessions that are explicitly ended.