pjc50's answer is correct, but needs more explanation. Like most positions of American political parties, it has to do with historical affiliations between groups, not philosophical principles. Specifically for the issue of gun control, firearms manufacturers and distributors were drawn to the Republican party because that party was pro-business.
It wasn't always this way. This is explored in the PBS Frontline documentary "Gunned Down: The Power of the NRA":
NARRATOR: But for the NRA, the gun wasn’t always a political issue. It had once represented something for hunters and sportsmen.
NARRATOR: Then the assassinations of the ‘60s— John F. Kennedy, Martin Luther King—
Sen. ROBERT F. KENNEDY (D-NY), Presidential Candidate: My thanks to all of you. And now it’s on to Chicago, and let’s win there.
NARRATOR: —and Robert F. Kennedy. Many American cities erupted into armed conflict. In response, Congress passed the first comprehensive gun control law in decades.
The Gun Control Act of 1968 had wide bipartisan support. According to ustrack.gov, House Democrats voted 157 in favor and 79 against; House Republicans voted 79 in favor and 39 against. In the Senate, 39 Democrats voted in favor and 13 against; Republicans voted 31 in favor and 4 against; and the Yea votes represented 91% of the country's population. Republicans actually voted for gun control in 1968 at higher rates than Democrats. The vast majority of those opposing gun control were in rural districts, at that time mostly held by Democrats.
WARREN CASSIDY, Former NRA Executive V.P.: NRA people said, “Wait a minute. We’ve got— we’ve got other things to worry about than teaching guys how to shoot or how to hunt, and so forth, or collect guns.” And that’s when— that was the transformative period.
NARRATOR: It formally happened in 1977 at the NRA Convention in Cincinnati. As they got down to business, there was a showdown, hunters and sportsmen versus gun rights activists.
CBS NEWS: [May 21, 1977] The National Rifle Association convention in Cincinnati went into overtime last night, a stormy all-night session. When it was over, some dissident members had taken control of the 400,000-member organization. What it means is even stricter support for the right to bear arms and against gun control.
JOHN AQUILINO: The core of NRA’s political support comes from a very conservative Republican group of people. They’re the ones who give the money. They’re the ones that pay the freight for all the political battles. And they’re very conservative.
But mainstream Republicans were still not on board. After an attempted assassination, President Reagan stayed out of gun politics. But his press secretary James Brady was severely disabled by the attack, and Brady pressed for more gun control legislation. The Brady Bill was introduced during the Bush administration, but it did not come to a vote then. It finally passed in 1993 and was signed by President Clinton.
Gun manufacturers and retailers were infuriated by the Brady Bill. They perceived it as a threat against their business. If only they could buy politicians opposed to gun control, they could stop this threat. They had the money to do it. They had control of the NRA, and could use that as their political vehicle. But which party should they back?
These were business owners, and the Republican party had a long tradition of being pro-business. Furthermore, it was cheaper to flip rural Democratic districts to Republican, than to flip suburban Republican districts to Democratic. So the decision was made to back pro-gun Republicans in the next year's election. They sent out mailers to the NRA membership...
TIM RUSSERT, Moderator, Meet the Press: [April 30, 1995] Aren’t you concerned when you say, “Nazi bucket helmets, government thugs, kicking down doors, killing, maiming people”— aren’t you inciting people? Aren’t you willing now to apologize for the tone of this letter?
WAYNE LaPIERRE: Those words are not far— in fact, they’re a pretty close description of what’s happening in the real world.
PAUL BARRETT: And in response to that, many mainstream Republicans, George H.W. Bush being the leading example, said, “This is not the NRA I’m a member of.”
NARRATOR: President Bush resigned his lifetime membership in the NRA.
But it worked. The 1994 election flipped 54 seats in the House, giving Republicans the majority for the first time in 40 years.
And it has simply polarized and escalated between the two parties since then.