It depends on the pistol
The 19th century spans a number of revolutions in firearms including percussion caps, revolvers, cartridges, smokeless powder, and semi-automatic pistols. It spans everything from a single shot, muzzle loading, flintlock pistol using black powder...
To a recognizably modern cartridge revolver like the iconic Colt Single Action Army of 1873, but still black powder...
To the first commercially successful semi-automatic pistol, the C96 "Broomhandle" Mauser in 1896.
Black Powder, Yes. Smokeless Powder, No.
Modern firearms use "smokeless" powder which is more powerful than black powder and, surprise, doesn't produce smoke. It's made of various things including nitrocellulose. None of this would be available in 14th century England and a cowboy would not know how to make it.
While smokeless powder was invented in the mid 19th century, black powder was used well into late 19th century. Fortunately for your cowboy, many of the pistols available to them would be black powder. And 14th Century England would be familiar with black powder. A little careful experimentation would find the right amount and grind to work safely and effectively.
Flintlocks Are Easy
A flintlock is easy enough to deal with. All you need is a lead ball and some black powder. 14th century England would have plenty of lead, it's a byproduct of silver mining. No percussion cap is necessary, the flint striking steel provides the spark to light the powder.
With some care and trouble they could probably even copy a flintlock. The biggest problem would be the springs and metallurgy, but the very simple design gives them a lot of wiggle room. In a pinch they could replace the flintlock with a matchlock.
The lack of smokeless powder rules out any sort of semi-automatic pistol. Black powder leaves a lot of residue which would rapidly gum up the moving parts.
In addition, early semi-automatic pistols like the Mauser C96 were recoil operated meaning they use the recoil energy from firing the bullet to work the action and chamber the next round. Since black powder is weaker than the smokeless powder they're designed for, it would not have enough recoil energy to cycle the action. You'd have to cycle the gun manually.
Brass Cartridges Are A Problem
At the other end of the spectrum is any pistol that takes cartridges like the Colt Single Action Army / Peacemaker or the C96 Mauser. Cartridges required a lot of trial and error to get right. They require a very thin brass case made to exacting tolerances which 14th century England would not have the metallurgy to make in any quantity.
As someone who's accidentally fired the wrong caliber cartridge in a pistol, a .40 in a .45, you don't want to get this even a little bit wrong. At best the burst case gets stuck in the cylinder. At worst it blows up in the shooter's face.
What about reloading cartridges? A cowboy might know how to do that, but not all cartridges are reloadable. And you have the serious problem of replacing the primer (see below).
Primers Are A Problem
Anything after a flintlock requires a primer, some chemical sensitive enough to explode when struck by the hammer, but inert enough to not go off from being jostled around. Primers are made of mercury fulminate which would not be available in 14th century England. Bullets have primers in their base. Others use little caps like a cap gun.
The Sweet Spot: A Cap And Ball Revolver
A cap and ball revolver is a revolver that doesn't use metal cartridges. Instead, each cylinder is loaded with black powder and a lead ball like a muzzle loader. This gives our cowboy the relative speed and mechanical simplicity of a revolver, without having to try to make brass cartridges. A good and popular example is the Colt 1851 Navy.
However, it does need percussion caps filled with an explosive primer. This is going to require some chemistry that doesn't exist in the 14th century and that your cowboy is unlikely to know.
It might be possible the revolver could be retrofitted to use flint or a match in place of the cap, but I've never heard of such a thing.
"Making X Is Easy! Just Put Y into Z!"
There's a bunch of comments of people saying that making this or that chemical is easy. There is no "just" when it comes to making explosives. And there is no "just" for doing anything in the 14th century. The question of whether a 19th century cowboy could, even with all the help of the King of England, make smokeless powder and primers for their gun is one that deserves its own question and answers. But here's my take.
Your typical cowboy, or anyone from the 19th century, will have no chemistry education. If it's early enough in the 19th century they're lucky they can read. Maybe they conveniently worked in a gun shop, but the probably weren't mixing explosives. So the author has to explain why this 19th century cowboy knows how to make smokeless powder and primers from scratch.
If they were making explosives, they definitely weren't mixing up the ingredients themselves. If they were then they're not a cowboy, they're a chemist. Even in the 19th century one can order a bottle of this or that and be sure of what they're getting. In the 14th century there are no purified chemicals to work with. There are few standard measurements. Even if our increasingly atypical 19th century cowboy knows that, for example, Aqua fortis is Nitric Acid necessary for the production of guncutton, do they know what strength the solution they're buying is? Do they know what impurities it has in it? Do they even know it's what they say it is? Working with impure or mislabeled chemicals is a good way to get blown up.
Finally there's the problem of remembering formula and procedure. There are no chemistry textbooks to refer to in the 14th century. Unless this cowboy is like Ash Williams and brought a practical chemistry textbook along with them in the
trunk of their car saddlebags of their horse...
...they won't be able to rattle off the formulas and procedures for making mercury fulminate and nitrocellulose, much less make it consistently to the tolerances for the smokeless powder in their bullets to avoid damaging their irreplaceable gun.
Let's list it out. In order to make smokeless powder and primers for their revolver our "cowboy" needs...
- To have memorized the formulas, ratios, and procedures.
- To know the 14th century names for the ingredients.
- To somehow find and verify pure samples of the ingredients.
- Not blow themselves or their gun up in the process.
It's not impossible, rather those are the plausibility hurdles the OP's story has to overcome.