I'd recommend doing some searching in the archive here, as there are quite a few threads talking about firearms or melée weapons vs armour (or armor), and the decline in use of armour.
Late medieval armour was very resistant to melée weapons. A sword will not cut through plate armour. Soldiers increasingly turned to weapons which could cause concussive injuries, could concentrate the force of a blow into a point, or could trip/knock over an opponent (making it easier to attack weak points in their armour, like slipping a dagger through their visor).
Armour was also very resistant to arrows. Firearms, however, could be made with greater penetrative power. Relatively early firearms seem to have had something in the range of ten times the initial energy of a crossbow. An arquebus or a pistol could punch through a steel breastplate and seriously injure the wearer, something that's very difficult for an arrow. That doesn't mean armour was useless. It could still protect against other weapons, glancing hits, and shots from longer ranges. However armour comes with costs. Most importantly, it's expensive and it's heavy, so you're slower on and off the battlefield. (If you're on a horse, you also need a larger, more expensive horse to carry the weight.) So firearms changed the cost:benefit ratio of armour.
From the 15th century onwards you can see firearms and armour both developing in effectiveness. Firearms became more effective, particularly with the introduction of more powerful 'corned' gunpowder. Units of arquebusiers might also have some more powerful, heavier, larger calibre weapons (the first use of the term "musket").
On the other side, armourers worked to make armour more resistant to bullets. I've been trying to find some good examples of armour with 'bullet proof' (or 'pistol proof') marks. Here's one showing the mark of a bullet fired to test its resistance, though I can't vouch for its authenticity. There seems to have been some debate about the effectiveness of armour, and its use also seems to have changed in light of experience - for example soldier in the English Civil Wars generally became more lightly armoured as the wars went on (even though the general standard of equipment improved).
Of course, all other things being equal, this tended to make armour more expensive and heavier. There's a slow process of soldiers wearing less armour. This wasn't just down to firearms, it's because of other changes, such as an increase in the size of armies, how they were raised and equipped and the distance they had to travel. I could give a quick outline of these factors but don't know enough about the period to properly discuss them.
(Main source for this is Weapons and Warfare in Renaissance Europe by Bert Hall. I've also just stumbled across this interesting book on google books, but have only skimmed it.)
(edit: typos.)
To add to the overview provided by u/tiredstars , this previous answer by me covers the parallel developments of armour and gunpowder weapons in the 16th century, particularly attempts to strengthen armour in the face of stronger weapons.
It is worth noting that the period from the initial deployment of personal firearms in large numbers in the Hussite Wars of the early 15th century to the mid 16th century (when firearms become both more common stronger) plate armour became more common than ever even as it became more metallurgically advanced (and, people like me would say, more artistically refined). It was not the initial introduction of firearms but their further refinement and their mass deployment in the late 16th and 17th century (as well as changes in army composition and tactics that caused the gradual reduction and eventual abandonment of armour.
And just to add some perspectives to the awesome answers already posted here from the other side of the world, the introduction and spread of the arquebus coincidenced with an increase in armour thickness and protection in Japan.
To add a bit on the physics side of the armour vs firearm problematic:
In order to prevent a injury on the body behind the armour, you have to prevent enough pressure on the body to deform it. Steel armour absorbs the energy kinetic of the bullet into plastic deformation of the armour. As steel has a high tension strenght, a lot of energy is required deform the armor enough to hit the body behind. Unfortunately, if the pressure on the steel is too high, steel begins to "flow" and its tension strength drops dramatically (Try bending a nail. At one point it starts to get very easy). This is the case if a musket bullet hits steel armour and it changes the game between increasing weapon strenght and armour thickness. At this point, adding more steel to the armour will never outweight the disadvantages (price, reduced mobility)
Kevlar armour works on a completly different principle: Kevlar consists of lots of microscopic fibers. If a bullet hits the fibers, they don't bend (the energy is not absorbed into deformation), they start to vibrate. As the fibers are closely packed, the vibrating fibers hit immediately other fibers in their movement, which also start to vibrate. This way, the kinetic energy of the bullets is quickly spread over the full armour surface before being transferred to the body behind. As the full energy is now spread over a huge surface (compared to the tip of a bullet), the corresponding pressure is low. The wearer will still have a few broken rips and the total recoil on his body will probably send him to the ground, but he will not have a huge hole in his body. Obviously, realising these differences and creating a micro-material like kevlar requires a lot more chemical knowledge then people had in the 16th century. They just realised that they would have to add more steel then one could carry to stop a musket or even rifle bullet.
Now thinking about it, i wonder how an old greek linothorax armour (stacks of linen and glue) would have performed against muskets if one adds enough layers.