From Zelda Wiki, the Zelda encyclopedia
Ocarina of Time
In Ocarina of Time, Link tries to gain access to the Sacred Realm, after retrieving the three Spiritual Stones and playing the Song of Time in the Temple of Time, so that he can take the Master Sword and can prevent Ganondorf from obtaining the Triforce. However, because Link is too young to use the sword, he is sealed in the Sacred Realm during seven years, thus awakening in a distant future as an adult. After he rescues Saria in the Forest Temple, however, he can return to his childhood by putting the Master Sword back into the Pedestal of Time. From this point, he can freely travel through time between his childhood and his adulthood. Certain tasks can only be performed as a child, and certain tasks only as an adult. Items such as the Slingshot can only be used by Young Link, while items such as the Fairy Bow can only be used by Adult Link.
In Majora's Mask, Link arrives in Termina after the Skull Kid steals his Ocarina and kidnaps Epona. Few hours before a tragedy occurs in the land, he manages to recover the instrument from his enemy, and uses the Song of Time to travel back to the past. From this point, the young hero must explore Termina while keeping an eye on the day and the current time and, when a total of three days is about to pass, play again the Song of Time to restart time in order to restart the three-day cycle that will result in the apocalypse if Link doesn't find a way to prevent the Moon from crashing into the Earth. Some variations of the Song of Time allow Link to slow down time and to make him travel a half day forward to the future.
Oracle of Ages
In Oracle of Ages, using the instrument of a kidnapped oracle Link travels between present day and 400 years previous with three temporal songs to open Time Portals or independently flit between eras.
As Link is looking for the missing pieces of the Mirror of Twilight, which is vital to gain access to the Twilight Realm, he finds a portal that takes him to an ancient version of the Temple of Time. This portal is the Door of Time, the gateway betwen Hyrule and the Sacred Realm. It's the only way one of the fragments of the mirror can be retrieved, and when Link travels back to the future, an item he found in the dungeon (the Dominion Rod) is affected in that its magic is inactive in the present, so he has to retrieve that magic in order to find the following dungeon.
In the Lanayru Mines and Lanayru Desert, Link can hit Timeshift Stones to alter time within the immediate vicinity of the stone. When struck, the Timeshift Stones replenish the area in its range, reverting it back to when the region was prosperous.