In the United States, the use of guns is outlined through the Second Amendment of the United States Constitution.
Although the right to bear arms is somewhat ambigous based on the controversy surrounding the interpretation of the amendment (it is still unclear whether the founding fathers were declaring the right to bear arms for organized militias or individual citizens) it is still declared as the general framework for which gun laws are based off of. That being said, gun laws in the United States are created by state governments through their particular interpretation of the United States Constitution.
State laws regarding gun use vary from the intensely scrupulous to fairly lenient. A state government creates gun laws through their consitution based on their individual sentiment towards gun use and their desire to limit gun use. All gun laws are created by local government agencies through an interpretation of the broader United States Constitution.