The Seven Sages are a group of individuals destined to aid a chosen hero in times of crisis; as such, they possess varying magical powers and responsibilities. Each era has its own group of sages, and those groups often aid Link in different ways (though only after they are rescued).

The Seven Sages (originally called “Wise Men”) are first mentioned in A Link to the Past. The in-game story reveals that during the great Imprisoning War fought between the evil Ganon and the Knights of Hyrule, the Seven Sages combined their powers to banish the wicked sorcerer and seal him in the Sacred Realm; Ganon’s corrupt heart then warped that region into the Dark World. After a few centuries, the wizard Agahnim appeared and placed spells on the King of Hyrule and his knights, bringing them under his control. Agahnim gathered the Seven Maidens—the descendants of the original Sages–including Princess Zelda herself—and leached from their power to break the seal to the Dark World to resurrect Ganon. Link, after defeating Agahnim, journeyed across the Dark World to free the Seven Maidens, who used their combined strength to open the way to Ganon’s Tower, the final dungeon of the game. After defeating Ganon and making a just wish on the Triforce, Link returned the Maidens to the Light World.

Source: Characters of The Legend of Zelda – Wikipedia