There are many ways by which you can automatically sign out of your Gmail account. The easiest way is to access Gmail in Incognito mode. If you access Gmail using a private window, it will automatically log you out once you close the browser window.