Lifelink is a static ability that modifies the rules for damage. Under CR 702.15b, damage dealt by a source with lifelink causes its controller to gain that much life at the same time the damage is dealt. This happens in any combat, including your opponent's combat phase.
The key point is that lifelink is not a triggered ability — it does not use the stack. The life gain is simply part of the damage event itself (CR 702.15b, 119.3f). So whenever your creature with lifelink deals damage, you gain life immediately, no matter whose turn it is or which player's creatures attacked.
This commonly matters if your creature with lifelink is attacking (because it has vigilance or was granted an extra attack), if it blocks during your opponent's combat, or if it is somehow dealing combat damage during the opponent's turn through other effects.
Concrete example: Your opponent attacks you with a 3/3. You block with your 2/2 that has lifelink. Both creatures deal combat damage simultaneously. Your 2/2 deals 2 damage to their 3/3, and you immediately gain 2 life — even though it is your opponent's combat step.
There is no restriction in the rules limiting lifelink's life gain to the lifelink creature's controller's own turn. CR 702.15b simply says "damage dealt by this source" causes the life gain, with no turn restriction whatsoever.
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.