WASHINGTON—President Donald Trump’s calls for changes to gun laws in the wake of last week’s Florida school shooting push Congress toward a new politically fraught debate just months before the midterm elections.

For more than a decade, and after multiple attacks on students, lawmakers have shied from making any significant changes to gun legislation in part because of the influence of the National Rifle Association. The NRA not only donates large amounts of campaign cash, mostly to Republicans, but its scorecards on politicians’...