If an effect would cause you to gain life past your maximum life total, you won’t gain any life above your maximum life total. For example, say your life total is 8 and your maximum life total is 10. You cast Azorius Herald, which has “When this creature enters, you gain 4 life.” You’ll gain 2 life, putting your life total back up to its maximum of 10.