Facebook doesn't log you out, it does provide a way to close a session when you're not at the computer where the session is logged in. If you think you've left yourself logged in on someone else’s phone, you can always end an active session from your Facebook app's Security Settings.
For more details: Sign out of messenger