There is no set lifespan for resin. Some softeners may continue to function well with the same resin for over 20 years while others, may need to be replaced within a few months.
The composition of the water will influence resin longevity. Some elements contained in water such as iron, can build-up and foul resin, resulting in a loss of softening capacity if the resin is not appropriately regenerated and maintained. Water hardness and regeneration frequency will also likely have some effect.
Continuous exposure to an oxididant such as chlorine, will usually lead to more rapid failure of the resin's crosslinking, causing the resin to swell and become mushy which is often recognized through a significant loss of flow through the softener. It's not just the presence of chlorine but also the strength. Although resin with 10% cross-linking will better tolerate constant chlorine exposure than standard 8% resin, the resin will continue to degrade more rapidly than if chlorine was not otherwise present.
There are now plenty of softeners that are equipped with low quality resin that has 6% or 7% (or possibly less) cross-linking, so it is a reasonable assumption that those resins will require rapid replacement within only a few years, or even less.