The sword of Gryffindor was made a thousand years ago by goblins, the magical world's most skilled metalworkers, and is therefore enchanted. Fashioned from pure silver, it is inset with rubies, the stone that represents Gryffindor in the hour-glasses that count the house points at Hogwarts. Godric Gryffindor's name is engraved just beneath the hilt.
The sword was made to Godric Gryffindor's specifications by Ragnuk the First, finest of the goblin silversmiths, and therefore King (in goblin culture, the ruler does not work less than the others, but more skillfully). When it was finished, Ragnuk coveted it so much that he pretended that Gryffindor had stolen it from him, and sent minions to steal it back. Gryffindor defended himself with his wand, but did not kill his attackers. Instead he sent them back to their king bewitched, to deliver the threat that if he ever tried to steal from Gryffindor again, Gryffindor would unsheathe the sword against them all.
The goblin king took the threat seriously and left Gryffindor in possession of his rightful property, but remained resentful until he died. This was the foundation for the false legend of Gryffindor's theft that persists, in some sections of the goblin community, to this day.
The question of why a wizard would need a sword, though often asked, is easily answered. In the days before the International Statute of Secrecy, when wizards mingled freely with Muggles, they would use swords to defend themselves just as often as wands. Indeed, it was considered unsporting to use a wand against a Muggle sword (which is not to say it was never done). Many gifted wizards were also accomplished duellists in the conventional sense, Gryffindor among them.
There have been many enchanted swords in folklore. The Sword of Nuadu, part of the four legendary treasures of Tuatha Dé Danann, was invincible when drawn. Gryffindor's sword owes something to the legend of Excalibur, the sword of King Arthur, which in some legends must be drawn from a stone by the rightful king. The idea of fitness to carry the sword is echoed in the sword of Gryffindor's return to worthy members of its true owner's house.
The Sword of Gryffindor