No, if you're divorcing there may be such provisions but if you're married and your partner dies, the spouse can get benefits. If the person who died was already collecting a pension though, it depends on how they took the pension. Usually you can opt for a higher amount that dies with you, or a lower amount that still gives your spouse something when you die. (Note for non American readers, we are talking about private pensions here, not your "pensions" from the government that are equivalent to our Social Security).
Incidentally, it's my understanding that there is not a minimum time to be married to collect Social Security survivor benefits, although if your spouse dies of a terminal illness shortly after marriage, they may investigate to see if it was a real marriage or a sham to get benefits.