The easiest way to do so is to listen for the jwt.refresh-token.revoke event.
It's documented here: https://fusionauth.io/docs/v1/tech/events-webhooks/events/jwt-refresh-token-revoke
In particular, you have the date of the revocation (the end of the session). If it is an individual session revocation, you have the start date, which is the startInstant inside the events refreshToken field.
If your webhook processor does the subtraction of these two values, you'll be able to find and record the duration of the session length.