A player resigns when they resign, for their own reasons. I resigned a game today because I was tired and thinking about real world™ issues. My opponent messaged me expressing surprise and saying he thought it was my game to lose. I just wasn't seeing it.
In short (or I guess long...) you can't generalize or assume. Sometimes I stay in a lost game just to see how lost I am (and yes, to see if a blunder may occur). It's all valid, all good.
To resign a game is to acknowledge that your opponent has reached a position so strong that only through gross mistakes would he/she lose. It is also a mark of respect because it assumes your opponent will not in fact make such mistakes.
When is the right time to resign a game?
To my mind, resigning should be done as soon as the unwinnable position becomes apparent. Resigning a move or two before certain checkmate is actually a mark of disrespect, as it removes the opportunity for your opponent to make the killing blow.
Your thoughts?