Assuming normal wear and tear, how long before a knight had to replace his sword?
Anywhere between "after first serious use" and "never". Assuming thorough, regular maintenance, a sword can last almost indefinitely - the oldest one I've held that has seen use was about 250 years old and might still be usable, given a good cleaning. The oldest one that I've seen was about 1500 years old and while thoroughy rusty, was worn (indicating regular sharpening and use), but seemed solid.
The problem with trying to determine something like that is that medieval swords never really were consistent, especially where the quality of steel is concerned; sword steel of consistent quality wasn't broadly available before about 18th century, and before then, swordsmiths were mostly at the mercy of their ore. When someone happened to be able to consistenly produce (or at least, get their hands on) high-quality sword steel, their name would basically become legendary (as in the case of Ulfberth swords).
So, why would a sword need replacing anyway? A very handy property of steel is that it can be ground and sharpened repeatedly without affecting its mechanical properties; a sword would have to be sharpened a whole lot more than would be considered reasonable by any standard to become unusable. Simply put, a steel sword doesn't really "wear out".
Because of the hit-and-miss nature of medieval metallurgy, a common mode of failure was catastrophical breakage caused by hidden faults within the steel (mostly because the swordsmithing methods of the time would give you a material rife with microsopic pieces of slag in the process of trying to get the carbon content into a reasonable range), which may or may not randomly manifest when the sword gets a good jolt in just the right spot. Of course, this would often happen in a life-or-death situation, so you would likely not end up in any shape to be needing a replacement sword anyway.
Another reason why you might need a sword replaced would be if you got a dent in it too big to be ground out, but again, this requires contact with a blade of similar or superior quality along with an unhealthy dose of sloppy swordsmanship, and doesn't really depend on the age of the sword anyway.
Of course, constant compulsive sharpening may eventualy make your blade too thin to be usable, but that's by no means a standard mode of usage. If you neglect maintenance, you may get rusting which may or may not be repairable, depending on the conditions, but if you seriously intend to rely on your sword to protect yourself, you do not neglect it.
Bottom line, if you get a good sword (that does not fail catastrophically) and take good care of it, it will last you a lifetime. After that, either whoever killed you will let it rust on the field of battle, or alternatively, one of your descendants might take it up and go on using it (or they will decide it doesn't suit them and stash it in the family armoury).
If you go to an old farm, you may be surprised to find out that a lot of the metal tools in the shed have the metallic part dating back 50 or even older than that without significant degradation other than rust and some chips. The wooden parts however have long been replaced with newer material, and the edge is periodically resharpened. I wouldn't be surprised that some metallic part of swords and other arms would go on to last several decades, until it finally break on usage or is deemed too damaged to repair.
well, i think it's fairly random. When you say knight, i presume you are referring to a medieval longsword.
It depends on many factors such as make, luck and ultimately what the sword is used for/against. If it was a civilian weapon used for duels and self-defense, it would probably last more than a battle weapon used against polearms, axes, maces and various layers of armour.
I do Historical European Martial Arts and i already broke one decent quality high carbon steel longsword in about 18 months of sparring. Mind you, in some cases, the blade can be replaced.
I'd say the average life expectancy for a standard modern longsword reproduction that is intensively used for sparring is about 2-3 years. Common things that may happen: ruining the hilt, breaking the blade or the crossguard. And keep in mind that we generally don't use longswords against steel armour (we wear modern padded armour) or heavy weapons.
I'd have to agree with the Mike L. As long as the sword or blade is of at least decent quality steel and make, and cared for properly ( cleaned free of blood, perediocally sharpened, and kept free of rust) and you use it as intened (killing things, not chopping down trees or digging up stones or anything like that) Then the sword will last pretty much forever. Of course, they don't usually last more than a few generations in families, either because a major catashtrphe happened to break them, someone went ahead and used them for something beside the intended use, or they were simply neglected and/or forgotten. These days, most such family weapons would never hold up in battle, and are decorative at best.