To end your Gmail session, click your account photo or email address in the top right corner, and select Sign out.
When using public computers like in a library or cybercafe, remember that you may still be signed into any services you’ve been using even after you close the browser. So when using a public computer, be sure to sign out.
If you've forgotten to sign out of another computer, you can sign out of your other session by going to the bottom of your Gmail, clicking Details, then Sign out all other sessions.