If the new "spouse" dies or the first spouse (the true spouse) dies, then the condition of sinfulness ends because the adultery no longer exists. But the person must repent and receive sacramental absolution.
If the first spouse dies, the second marriage would need to be sacramentalized in some way (marriage vows officiated by a priest) because it is an adulterous cohabitation until the Church recognizes its sacramental nature.