Click on the Command Menu button `Logout' or type meta-l meta-q. If there are unstored changes, you'll be asked if you wish to save them.