The Crystals are quest items from The Adventure of Link and A Link to the Past, though they have very different purposes.
The Adventure of Link
Link must place each of the six Crystals given to him by Impa in a statue at the end of each of the Palaces. Once all six Crystals have been returned, Link is able to break the Binding Force erected by the King of Hyrule, enter the Great Palace, and retrieve the Triforce of Courage.
A Link to the Past
The Crystals are diamond-shaped prisons where the Seven Maidens, including Princess Zelda herself, are kept. Each Crystal is kept in one of the seven Dark World dungeons and is acquired by defeating the boss in the respective dungeon.
The seven Crystals with the power of the Maidens are required to break the seal on Ganon's Tower and enter it.
First Crystal-encased Maiden, Dark Palace, A Link to the Past
Second Crystal-encased Maiden, Swamp Palace, A Link to the Past
Third Crystal-encased Maiden, Skull Woods, A Link to the Past
Fourth Crystal-encased Maiden, Thieves' Town, A Link to the Past
Fifth Crystal-encased Maiden, Ice Palace, A Link to the Past
Sixth Crystal-encased Maiden, Misery Mire, A Link to the Past
Seventh Crystal with Princess Zelda, Turtle Rock, A Link to the Past