The earliest mention of William Tell is in the White Book of Sarnen, a fifteenth century compilation of various documents in the archive of the town of Sarnen; it mentions William Tell as part of the history of the Old Confederacy of the Swiss. This is not the source of the William Tell legend, however; he was a folk hero well before that, and the Tellenlied, or song of William Tell, although it was first written down in the early sixteenth century, probably predates the White Book, at least in its earliest forms.
What made William Tell more than a local hero, however, were revolution and Romanticism. William Tell became a symbol both of fight against tyranny and of national heroism in the French Revolution. Toward the eighteenth century, Goethe was traveling around Switzerland and came across the tales of Tell. He intended for some time to write a play about William Tell but eventually passed his sources on to Friedrich Schiller. Schiller's William Tell, the next fortnightly book, was first performed and published in 1804. The play became an international sensation.
Rossini's opera is based on a French adaptation of Schiller's play, so here's the famous Finale to its Overture (officially known as "The March of the Swiss Soldiers") to get us going: