On February 1, 1284, Edward I's queen Eleanor gave birth to a son at Caernarfon Castle, their eleventh child. In a story which is probably apocryphal (i.e. it sounds good but is unlikely to be true), Edward invited several powerful Welsh princes to the castle.
There he wined and dined them until they were feeling quite jovial. Seeing the state his guests were in, Edward asked them if they would be willing to serve a prince who spoke not a word of English.
The Welsh, naturally, assumed he meant one of their own number, a Welsh leader. When they agreed, Edward showed them his sleeping son, and proclaimed, "Here is your man!" The chagrined Welsh could not go back upon their word, and swore fealty to the infant prince.
We are on firmer factual ground with what happened next. On 10th May 1301, when Prince Edward was 16 years old, he was formally invested (i.e. officially named) as Prince of Wales in a ceremony at Lincoln. Edward I chose the title Prince of Wales in conscious imitation of his old enemy Llewelyn the Last.
Llewelyn had used the title from 1258 to emphasize his leadership of the entire Welsh people, not just his own kingdom of Gwynedd. Although Llewelyn was on pretty shaky legal ground with his title, Edward had no compunction proclaiming his heir a prince of all the land and people of Wales.
Over the centuries since that first investiture, the future male heir to the crown of England has been named Prince of Wales. The title is not hereditary - that is, it is not automatically conferred at birth. It must be conferred in an official ceremony of investiture.
Over the centuries various items of jewellery have been created and worn especially at these ceremonies. This jewellery now makes up the official Welsh Crown Jewels, some of which is stored at the Tower of London and some at the National Museum of Wales in Cardiff.