There are various gunsmith programs available. Usually people who have a passion for firearms etc go for such courses. You can find basic level courses as well as advanced courses that train you on the basics of gunsmithing and then proceed with the functions of weapons. Mostly people take up certificate courses that are one year long.