There would not be any licensing: there would instead be training, learning from another gunsmith, working in a gunsmith's shop...just like people learned blacksmithing, or dressmaking, or any of a number of other trades. Then it was a matter of capitalization: the money to buy tools, equipment, stock in trade, and pay the rent. But what was learned depends upon when, in the Wild West. The 19th c. was, of course, the era of industrialization, and that affected the making of guns just like it affected the making of other items, like door locks and shoes. There were also innovations in the design. Generally speaking, before 1860 a gunsmith could be a manufacturer of guns. Muzzle-loading guns were reasonably simple, so he would very likely buy completed locks, buy gun barrel blanks that he would ream to finish and rifle ( if he was making rifles) buy, make or cast the furniture ( buttplates, ramrod thimbles, etc) carve and inlet a stock to hold them all, and then carve, engrave, and finish it. .A good example of one of these shops would be that of the Hawken brothers, who learned their trade in the east, shifted to the frontier in the 1820's and made their famous rifles in St Louis. But a gunsmith might not be in a small shop. Even in the early 19th c., there were very big shops , like Leman's in Lancaster PA, that employed a lot of hands and so could take advantage of economies of scale
However, after about 1860, with the advent of breech-loading guns that used metallic cartridges, guns became more complex and so required more machine tools to efficiently manufacture. And then an actual factory, like Winchester or Colt, mostly made guns, and gunsmiths increasingly were repairmen- or, they simply went out of business, were replaced by gun dealers. Or, started their own factory, like John Moses Browning of Ogden Utah, possibly the best gun designer in history.. In that, they were just like blacksmiths and locksmiths. If they were lucky, they were able to customize guns for the luxury market, like making target rifles from factory-made actions and reaming and rifling their own barrels ( like George Schoyen, in Denver). Of course, even then they would face competition from the big makers- Winchester and Colt would have gunsmiths in their factories doing custom work, fine engraving and carving etc.