The following is a timeline of the events that take place in Skyward Sword, told in chronological order, starting with the creation of the Triforce. I wrote it to try to make sense of some of the potential time paradoxes. Some of the information here is based on my non-canonical assumptions.
The War of the Triforce
The three goddesses Din, Nayru, and Farore, create Hyrule, its people, and the Triforce. They entrust their creations to the care of the goddess Hylia.
An evil entity called Demise creates an army of monsters to seize the Triforce. Hylia creates Skyloft and places the Triforce there along with her human followers.
Hylia fights a long war against Demise, and although she is gravely injured, Hylia finally imprisons him in the pit at the Sealed Grounds, creating the Sealing Spike and driving it into his forehead.
However, Demise's sword, Ghirahim, survives and is not sealed away.
The Goddess's Plan
Because of her injuries, Hylia knows that if Demise breaks free again, she will not be able to stop him. She knows that the Triforce has the power to destroy the Imprisoned, but the three goddesses designed the Triforce such that it cannot be used by a deity.
To bring about the Imprisoned's destruction, Hylia creates a plan that will lead to the arrival of a chosen hero who can use the Triforce to destroy the Imprisoned for her.
Hylia first creates the Goddess Sword and its spirit, Fi, who will guide the Hero in the quest to defeat the Imprisoned.
Hylia then relinquishes her immortality and divine powers to allow her soul to be reborn in the body of a mortal in Skyloft. This mortal reincarnation will return to the Temple of Hylia to maintain the seal on the Imprisoned, while at the same time providing the motivation for the chosen hero to endure the trials necessary to strengthen his spirit and become worthy of wielding the Triforce.
In her final moments as Hylia, she gives Impa the task of using the Gate of Time to find her mortal reincarnation and guide her to the goddess statues to regain her memory before taking her to the past to maintain the seal on The Imprisoned.
Hylia then disappears.
Zelda's Long Sleep
Some time after, Zelda and Impa appear in the past. Zelda is now aware of her memories as Hylia.
Link arrives bearing the Master Sword. He reunites with Zelda, who explains the truth about herself and Link's mission as the chosen hero. Since Link has gained wisdom, power, and courage in his trials, he has proven himself worthy of his task, and she awakens in him the ability to obtain the Triforce, making the symbol on the back of his hand glow. She blesses the Master Sword, turning it into the True Master Sword.
Hylia apologizes to Link. Only one with an unbreakable spirit can wield the Triforce's power, so she admits that she used him, sending him through trials that would awaken the hero within him, in order to achieve her goal of winning the war against Demise.
Then Zelda seals herself in a crystal to sleep for thousands of years while maintaining the seal on the Imprisoned.
Link disappears through the Gate of Time, but he returns soon after with the seedling from the Tree of Life. He plants it in the past, then goes back through the Gate of Time.
The End of Demise
Later, Ghirahim comes through the Gate of Time carrying Zelda. At this time, there are two Zeldas in existence: the one sealed in the crystal, and the one whom Ghirahim is carrying.
Link comes through the Gate of Time carrying the True Master Sword, and at some later point, Groose appears through the Gate of Time as well.
The Sealing Spike is not present in the pit when Link finds Ghirahim there, but it is possible that Ghirahim put it somewhere else when he began his ritual to separate Zelda's soul from her body.
Link fights his way through Ghirahim's horde of monsters. Ghirahim transforms into a dark being who resembles Fi, and he fights Link while continuing the ritual. Link defeats Ghirahim, but Ghirahim completes his ritual, and Demise is resurrected after consuming most of Zelda's soul. Zelda is cast aside, but Groose catches her and takes her back into the temple of the Sealed Grounds, where he and Impa watch over her.
Ghirahim is tranformed back into Demise's sword, gladly giving up his life to serve his master.
Link follows Demise into the realm that he created, and after a fierce battle, Link kills Demise with the True Master Sword.
Before Demise dies, he casts a curse that will make his hatred manifest in a mortal reincarnation who will fight against all future reincarnations of the Goddess and Hero.
Demise's residual consciousness is absorbed into the Master Sword and sealed away. Zelda's soul is released and returns to her body. Since Demise's consciousness still exists within the Master Sword, the Imprisoned becomes sealed again in the Sealed Grounds using the Sealing Spike that Hylia created when she first sealed Demise away.
Link goes back to the temple of the Sealed Grounds, where Zelda has recovered. Link places the True Master Sword into the pedestal, and Fi bids Link a fond farewell before beginning her eternal sleep within the Master Sword.
Impa chooses to stay behind in the past to watch over the Master Sword and ensure that Demise's consciousness stays sealed within the blade. Zelda gives Impa one of her bracelets, and, possibly, uses magic to give Impa an extended life span.
Link, Groose, and Zelda go through the Gate of Time, but the other Zelda still sleeps within the crystal to maintain the seal on the Imprisoned, who was sent back into the seal in the Sealed Grounds when Link killed Demise.
Zelda or Impa use magic to conceal the Master Sword and the Tree of Life in the temple.
Many thousands of years pass, with Zelda sleeping in the crystal to maintain the seal on the Imprisoned.
The Spirit Maiden's Quest
Link and Zelda are born on Skyloft. At this time, two Zeldas exist. The other Zelda still sleeps within the Sealed Grounds temple, maintaining the seal on the Imprisoned.
Before the Wing Ceremony, Zelda hears a voice calling her down to the surface. This might be the voice of her other self sleeping within the crystal.
Link wins the Wing Ceremony and receives the Sailcloth from Zelda. Afterward, Link and Zelda fly around Skyloft together. However, Ghirahim, who has been searching for Hylia's mortal reincarnation ever since Demise's first defeat at Hylia's hands, creates a giant black tornado that causes Zelda to plummet to the surface.
Zelda lands in front of the Sealed Temple. The old woman from the Sealed Temple tells Zelda of her true nature as the reincarnation of Hylia and tells her to pray at the goddess statues in the temples across the land. Zelda or the old woman have used magic to conceal the Tree of Life and the Master Sword residing within the temple.
The Hero's Trials
Link sees Fi in his dreams and is guided to the Goddess Sword. With it, he descends to the surface. A voice--possibly that of the Zelda sleeping in the crystal--tells him to use a skyward strike on the Sealing Spike at the bottom of the pit.
After he does so, the Sealed Temple unlocks. Link meets the old woman in the Sealed Temple. Unbeknownst to Link, the old woman has met him before. He is unaware that a second Zelda sleeps within the crystal in the other room, which he can see through the crack in the door. The old woman tells Link where Zelda has gone.
Young Impa, who has just been sent from the past for the first time by Hylia and thus has not met Link or the others before, follows Zelda, as does Ghirahim.
Link does not reach the Skyview Spring in time to meet Zelda, who has already prayed there.
Later, Impa rescues Zelda outside of the Earth Temple and helps her reach the Goddess Statue within. Link reaches the Earth Spring after Zelda and Impa have already reached it, and Impa chastises Link for arriving late, doubting his worth as the chosen hero.
Link reaches the Temple of Time in Lanayru, where Zelda has just used her power to activate the Gate of Time. Just as Link arrives, Ghirahim appears and attempts to capture Zelda. Impa holds him off while Zelda gives Link the Goddess Harp. Link rushes in to protect Impa after her magic shield gives way, and Impa tells Link to talk to the old woman in the Sealed Grounds temple. Zelda and Impa then go through the Gate of Time, which Impa destroys to prevent Ghirahim from pursuing them. Ghirahim disappears.
The Forging of Sword and Hero
Link encounters Groose while falling to the Sealed Grounds. In the temple, the old woman teaches Link the Ballad of the Goddess, causing an inactive Gate of Time to appear.
At this time, the seal on the Imprisoned becomes too weak to hold, and Link fights the creature to seal it once again.
The old woman tells Link to power up his sword with the three sacred flames, which will allow him to activate the Gate of Time in the Sealed Temple.
After many hardships, Link obtains the three sacred flames, turning the Goddess Sword into the Master Sword.
Using the Master Sword, Link attempts to activate the Gate of Time, but when he charges up his sword, the Imprisoned breaks free again. He seals the Imprisoned away once more.
Link then activates the Gate of Time and goes through. He emerges with the True Master Sword and the ability to obtain the Triforce.
The Quest for the Triforce
He finds out from the old woman that the location of the Triforce is not known. Owlan tells him that Levias would know, but Levias seems possessed. Link learns the Spiral Charge and uses it to destroy the parasite that possessed Levias. Link learns from Levias that he must ask the three dragons to teach him their parts of the Song of the Hero.
Link meets with the three dragons and learns their parts of the song. He then returns to Levias and learns the full song.
The End of the War against Demise
After playing the Song of the Hero, Link undergoes a final trial in the Goddess's Silent Realm on Skyloft, after which he gains access to the Sky Keep. There, he finds the three parts of the Triforce and makes a wish to destroy the Imprisoned. The Sky Keep plummets to the Sealed Grounds, crushing the Imprisoned and destroying it at last.
Link rushes into the Sealed Temple, where Zelda awakens and emerges from her crystal. She and Link and Groose share an emotional reunion, but Ghirahim appears and kidnaps Zelda, taking her through the Gate of Time. Link follows after, as does Groose.
Afterward, Link, Zelda, and Groose emerge from the Gate of Time. Ghirahim and Demise were defeated in the past.
The old woman is shown to be none other than Impa, who survived for thousands of years, possibly with help from Hylia's power. Impa then fades into a golden light and disappears.
Gaepora comes to the surface. Zelda embraces her father and tells him everything that happened. Cawlin and Stritch arrive with Groose's Loftwing. Groose returns to Skyloft with Cawlin and Stritch, and Zelda decides to live the rest of her life on the surface, watching over the Triforce. She asks what Link will do, and he tells Zelda that he will stay on the surface with her.