Instructions for the Time of Crisis.
An initial point of reference is found in the Gospel of Luke, where our Lord indicates the legitimacy of the right to self-defense, telling the disciples, “Let him who has no sword sell his mantle and buy one” (Luke 22:36).
It seems that this is Jesus' way of warning them that things are about to get much more difficult and dangerous for them. He probably meant the part about the swords figuratively, but they took it literally.
In a modern context, the Catechism of the Catholic Church acknowledges the right to use lethal force in self-defense, including on behalf of others, when the use of this force is moderate—i.e., when it is not practical to use less force (CCC 2264-2265).
The Catechism does not specify the means by which one may use lethal force in self-defense, but this may be inferred: If you are in a situation where the only effective means you have of defending your life (or that of another) is a gun, then you may use it.
It's always helpful to put what the Lord says in its proper context, before deciding to universalize it as a general rule. The Church has never condemned war outright, which she would have done if violence is never justified.
Furthermore, the above does not mean we as Catholics desire the use of weapons or support any gun groups.
Finally, the Holy See along with the U.S. bishops favor handgun restriction.