Can I make automatic log-out when Mac is asleep?
Yes, a sleeping Mac will prevent your account being logged out.

From a running process or application's perspective, time stops while the computer is asleep. Developers of applications need to actively monitor sleep wake cycles and adjust their timers accordingly. Many applications do not.

Third Party Tools

You can use third party software to log out before sleep or after a period of inactivity.



Power Manager, which is a product I work on, is able to trigger a log out on sleep, after inactivity, or immediately upon wake. Given you are running macOS 10.11, be sure to try the appropriate legacy version.

Be aware that performing actions on sleep is generally not advisable.