It depends on the game, but honestly you rarely need to formally quit. Simply stop playing for a while and the result is the same.
A handful of titles will suspend or ban an account after a long stretch of inactivity, so if a game is one you might return to, check its policy before walking away for months. Otherwise, closing the client is all it takes.