Kids ask the darnedest things. Your child has posed one of the big questions of the transition of late medieval warfare into the Early Modern period (as is often the case, simple questions are the hardest and most complicated to answer; this is one reason Phd Theses get so obscure!). Part of this is that the concept of Knight embraces a number of different aspects: if you take them to be aristocratic, titled (quasi-titled) soldiers fighting in full armour, often mounted, you are describing two things - a military role and a social position.
I will focus on the decline of the military role of fully armoured horsemen (most of whom were not knights on this period), and let others address the social aspect more fully. While this is often told as a simple story of technologically-driven obsolesce, the truth is much more complicated and multifaceted.
First, some timelines. Personal firearms in some form first having real military effects in the Hussite Wars of the 1420's and 30's. Guns stop looking like tubes on sticks which are ignited by holding a burning rope (a match) to them and begin to take on their recognizable form (some form of trigger mechanism, wooden butt held against the shoulder, fired from the shoulder) in the later 15th century. this earliest design that looks like what we'd recognize as a gun is called an arquebus. However, fully armoured men at arms (knights and those who fight as knights*) don't instantly go away. They continue to fight, and fight effectively, for decades - if you are measuring from 1420, for a hundred years and more. An armoured cavalry charge decisively wins the battle of Ravenna in 1512 - a battle that featured pike, cannon, arquebuses and all of the weapons of early modern warfare. As often happens in the history of technology, gunpowder did not instantly change the face of warfare; instead a hundred different innovations, technological, tactical and societal, combined to transform warfare.
Hopefully some of our military historians can cover the tactical and societal changes. Sadly, I study the history of military technology (among other things), so I can offer only a partial explanation. Now, this explanation is often offered as the full one, but I must stress that it is not a comprehensive answer to this very complicated question; it is a very important aspect.
Since I study the history of armour, I will focus on armour, and the increasing effectiveness of troops armed with firearms against troops wearing armour. This is an important factor in the decline of full armour. I wrote about this in a previous answer, quoted in slightly modified form below.
Now, this covers the technological aspects of full armour's decline, not the social aspects of the transition from knightly class to heavy cavalry that were more tightly controlled by the state (though many were still from the aristocracy). Hopefully another flair can fill in more information about this aspect, as well as more tactical context. This is a story with many aspects.
*And the transition toward a less titled heavy cavalry arm is a story in itself!
Give your son child my compliments for asking such an interesting question :). It's a complicated topic, but I'll try to write as plainly as possible without sacrificing context.
So, in about the year 900, a new social group appeared in the area that would later become France. They weren't yet called knights - our sources refer to them in Latin as milites and equites, meaning literally "soldier" and "horseman," respectively - but they were essentially knights. Now, there's some debate as to what their social position was at this time. The older view, expressed by a guy named Georges Duby, was that they were initially common soldiers who later rose in social status and became part of the aristocracy. More recent historians are leaning away from this and towards seeing them as minor nobles from the start and thus a continuation of the old Frankish aristocracy, not a new group. Regardless, they were high status warriors who fought from horseback with heavy armor, and they looked a lot like this.
What's not in doubt is that knighthood became a very prestigious institution in subsequent centuries. Even very powerful lords and kings wanted to be known as knights; William the Conqueror, for instance, was dubbed a knight while a teenager, despite being the duke of Normandy. The emergence of chivalric literature in the 12th century elevated it to new cultural and social heights. The result of Europe's infatuation with knighthood was that ordinary knights rose in status, but also acquired increasingly heavy social obligations and began to shrink in numbers. Their equipment also became significantly more expensive; by the end of the 12th century a knight looked more like this.
The 13th century was more-or-less the swan song of the knight's military supremacy. By the end of that century, and especially moving into the 1300s, most armored horsemen on European battlefields were no longer knights. They were called men-at-arms broadly, though many of them were also referred to as squires, despite being adult fighting men. It had simply become too expensive for the majority of western Europe's fighting men to become proper, dubbed knights. Knights continued to participate regularly in war for quite a while longer, but it became very rare to see an entire group of knights fighting together. It was much more common to see a knight leading a group of men-at-arms. Knights had essentially become lords who led other men into battle - when they weren't too busy dealing with their obligations at home.
It seems as though other posters have covered the topic pretty well, but hopefully I can add a bit more to the conversation.
During the 15th century, armored knights were forming a core part of many early standing armies. The French Compagnies d'ordonnance and institutions like them focused around heavily armored men-at-arms (gendarmes) drawn from the nobility and paid for their service, each supported by a handful of pages and servants who acted as mounted infantry or light cavalry in combat. These companies provided the king with a small, elite, mobile forces who could effectively deal with rebellions or rouge mercenaries, and they provided minor members of the nobility a chance to earn a good amount of income and prestige. For poorer aristocrats who couldn't afford the full panalopy of a gendarme there also arose a category of "second class gendarmes" who rode unarmored horses wore much less armor in general, serving as medium cavalry, but weren't nearly as respected as the "proper" men-at-arms.
Despite the growing dominance of infantry armed with pikes and firearms, heavy men-at-arms continued to play a major role in warfare for the first half of the 16th century. They suffered a number of disasters due to charging infantry in well-defended positions, but unsupported shot out in the open could still be easily run down by horsemen, and their superb armor occasionally still let them come out ahead against Swiss pikemen like at the Battle of Marignano. However, the prevalence of firearms was slowly forcing the gendarmes to adopt thicker armor that left them less mobile, forcing them into a more limited role on campaigns compared to what their lightly-armored associates were capable of.
The biggest blow to the reputation of the men-at-arms however came from the sudden rising popularity of the wheelock pistol and the german "reiter" cavalry towards the end of the Habsburg-Valois wars. These pistols were inaccurate from horseback and they lost energy quickly at a distance, but in close quarters they were more effective against armor than a charging lance, against the thicker armors they could be easily aimed at the rider's thigh, face, or horse, they outranged the longest pikes, and unlike a lance a rider could easily carry 2, 3 or more loaded pistols at a time ready to be used in quick succession. On the effectiveness of lances against modern armour, French soldier La Noue would later write:
I will say, that although the squadron of Speares doe giue a va∣liant charge: yet can it worke no great effect: for at the onset it kil∣leth none, yea it is a miracle if any be slayne with the speare: onely it may wound some horse,
on the other hand:
the Reistres are neuer so daungerous as when they bee mingled with the enemie, for then be they all fire.
During the 1550s and 1560s, despite technically being a match-up between medium horse and heavy horse, deep formations of reiters soundly broke the ranks of the Gendarmes at battles like Saint-Vincent, Saint-Quentin, and Gravelines. This was a major upset, and in order to stay competitive the gendarmes had to start reducing their armor and carrying a pistol or two to use once their lance had broken. Within a handful of decades there seems to have been little to differentiate a man-at-arms from the medium class of lancer with an unarmored horse and 3/4ths harness. A number of writers such as Sir Roger Williams soon began to question whether noble men-at-arms were really worth their higher salaries, or whether they were superior to lancers comprised of gentlemen in the first place.
The lance itself didn't go away immediately, rather French lancers seem to have returned to prominence somewhat and experienced a number of successes in the 1570s and 1580s. According to Treva Tucker this was likely due to the rather unfortunate invention of the "caracole" tactic which came to be widely used by pistol-armed cavalry. Although it might also be that it was just more difficult to teach cavalry to charge home aggressively with pistols than with lances. In either case, it was becoming apparent to many observers that the advantage of lancers over pistoliers was relatively minor at best, and that the extra flexibility of horsemen with pistols and swords only to do service in a much wider variety of terrains and formations was too good to pass up. Not to mention that pistoliers required neither extensive practicing with the cumbersome lance, nor the same kind of high-end expensive horses that lancers did. By the end of the 16th century, the lancer had become almost extinct in western Europe.
Sources:
"Eminence over Efficacy: Social Status and Cavalry Service in Sixteenth-century France", by Treva J. Tucker
"The politicke and militarie discourses of the Lord de La Nouue"
Weapons and Warfare in Renaissance Europe: Gunpowder, Technology, and Tactics By Bert Hall
European Warfare 1350-1750 By Frank Tallett
The Italian Wars 1494-1559 By Christine Shaw
Military Experience in the Age of Reason Christopher Duffy
Elizabethan Military Science By Henry Webb
The Cambridge illustrated history of warfare: the triumph of the West By Geoffrey Parker