Hi anonymous user,
There is a security validation timeout setting in the Web Application -> General Settings in Central Administration. At the end of that amount of idle time the security validation for the session will be revoked. A user will need to log back in to refresh the page after that. It is set to 30 minutes by default in my environment.
To other office products, please take a reference to this post:
https://techcommunity.microsoft.com/t5/azure-active-directory-identity/default-session-timeout-behavior-and-duration-for-office-client/m-p/393702
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.