The maximum number of permanent hearts in Breath of the Wild is 30. Link begins the game with three heart containers and can expand his health by completing shrines, defeating Divine Beasts, and trading Spirit Orbs at Goddess Statues.
There are 120 shrines, each producing one Spirit Orb, and four Divine Beasts that provide additional heart containers when conquered. Because the game also allows stamina upgrades, a player cannot permanently max out both hearts and stamina through ordinary upgrades at the same time. The Horned Statue in Hateno Village can exchange heart and stamina upgrades, however.
The 30-heart figure refers to permanent red heart containers. Temporary yellow hearts from food or elixirs can appear beyond the normal health bar, so a player may temporarily display more health than their permanent total. Those bonus hearts disappear when depleted.
Link must have at least 13 permanent hearts to pull the Master Sword from its pedestal. This requirement is another reason heart upgrades matter even after the early game.