This tutorial will show you how to change the HungAppTimeout value to what you want for your account in Windows 11 and Windows 10.
The HungAppTimeout value is the default 5 seconds you wait on the Signing out, Restarting, or Shutting down screen when you sign out, restart, or shut down to see if any still open apps (tasks) will end (close) before considered "hung" or "not responding".
When the HungAppTimeout expires with unresponsive app(s) found, the End Task dialog appears asking you to click/tap on Sign out anyway, Restart anyway, Shut down anyway to force close the app(s) and lose anything unsaved, or click/tap on Cancel to cancel the sign out, restart, or shut down and return to the desktop to properly save and close the app(s)...