This quote comes in the middle of the lengthy conversation between the player King and the player Queen. They are playing The Murder of Gonzago, also referred to as The Mousetrap by Hamlet. The couple are discussing the possibility of the queen moving on to a second marriage upon her husband's death, as the King feels he is dying, or at least getting old enough to know that death is not out of the question. Directly before the King's speech, the queen says:
The instance that second marriage move
Are base respects of thrift, but none of love:
A second time I kill my husband dead,
When second husband kisses me in bed.
This passage serves to hit the real King and Queen in their hearts, as Queen Gertrude has done exactly what player Queen says she will not do - remarry.
The player King protests saying that the passion will grow old and weak and eventually, she will change her mind, because life dictates so. When he says "What to ourselves in passion we propose,/the passion ending, doth the purpose lose," he's telling her that it's only the "passion" she feels at the thought of his death that is making her say she will never marry. Once she gets over it and a little time passes, she will think differently and will probably marry someone else. This is meant to be similar to what actually happens with Gertrude and Claudius, after King Hamlet is killed.