Lifelink is a static ability that causes damage dealt by the creature to also cause its controller to gain that much life (CR 702.15a). Normally, if a creature with lifelink deals 3 damage, its controller gains 3 life simultaneously with the damage being dealt.
Leyline of Punishment has two relevant effects: players can't gain life, and damage can't be prevented. The life-gain prevention directly shuts off the life-gain part of lifelink. Because the life gain is replaced or forbidden entirely, the controller gains zero life, even though the damage still resolves normally (CR 119.3).
Specifically, Leyline of Punishment's replacement/prohibition effect means that when lifelink would cause life to be gained, that gain simply doesn't happen. The damage is still dealt — it's not prevented — but the downstream life-gain consequence of lifelink is nullified (CR 614.1).
Concrete example: You control a 4/4 creature with lifelink. Your opponent controls Leyline of Punishment. You attack and deal 4 damage to your opponent. Your opponent loses 4 life, but you gain zero life — Leyline of Punishment stops the life gain from lifelink entirely.
Note: this also means abilities or spells that trigger off life gain (such as Vito, Thorn of the Dusk Rose) will also not trigger, since no life is actually gained.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.