When the player leaves.
But the downside is of that is the chance of data loss. (when the server crashes) Yet, that part should be considered more as a feature than a must in my opinion. The most logic timing is when the player leaves.
For some data it is not an option to make use of the onPlayerQuit event timing, for example the data that is only stored at the client their PC shouldn't/couldn't be send over to the server when a player quits.