In the Legend of Zelda: Ocarina of Time, the Temple of Time is located near Hyrule Castle Town. There is a path leading out of Castle Town that leads to the Temple of Time.
In the Legend of Zelda: Twilight Princess, the Temple of Time is located in the Sacred Grove. Go to Faron Woods, a little bit before the final path to the Forest Temple, and Rusl will be waiting for you. He'll give you a Golden Cucco (chicken) and you use it to fly to the ledges that you had jumped to before as a wolf. Once you get to the Sacred Grove, the Skull Kid will be waiting for you. Follow him, and if there are a few pathways that you could go on and you don't know which way to go, look for the light of his lantern. He should lead you back to where the Master Sword was. Go to the Master Sword's pedestal, walk up to it, and there should be an action icon saying "strike". press the button and Link will put the Master Sword into the pedestal and take it out again, and that should open a door that leads to the Temple of Time.