You had to be wealthy enough to afford a knight's equipment. The body armor, the swords, the horse. That stuff wasn't cheap. So, for the most part, knight's were from the noble class. (Read: rich kids.)
After 14 years of training, a squire would be eligible to become a knight at the age of 21, if he had sufficiently proven his skill and honor on the battlefield. He would be giving the title at a "dubbing ceremony," where he would kneel before a king who would touch his shoulder with a sword and proclaim him a knight.