In a narrow victory for President Reagan, the House voted 217 to 211 last night to provide an additional $8.4 billion for the International Monetary Fund to help it cope with the world debt crisis.

Despite intense lobbying by the administration and personal appeals by the president, 94 Republicans voted against the measure, while 72 voted for it. The Democrats were also split, with 145 voting in favor, 117 against.

The vote, which came after five hours of debate over a number of amendments, ended several weeks of sometimes bitter controversy.

A statement issued by Treasury Secretary Donald T. Regan's office said the vote "is welcome news for world economic stability and America's national interest."

Rep. Jack Kemp (R-N.Y.), who opposed the bill, said he did not feel the Republican turnout was an embarrassment for the president. The victory "wouldn't have happened if it hadn't been for his personal intervention."

An administration source, who asked not to be identified, said, "We are reasonably well pleased." He said the administration was only counting on about 65 Republican votes.

The Senate already has approved the increase in the U.S. contribution to the IMF. The issue now goes to a House-Senate conference committee, where differences in the measures passed by the two houses will be negotiated.

Although the outcome of the measure had been in doubt until the vote was taken, the Reagan administration maintained throughout that it would win a slim victory.

The president had told House Republicans this week that rejection of the measure to increase lending resources for financially strapped Third World countries would be an embarrassment for the United States.

Before the final vote, the legislators faced 60 amendments, including one that would have made the increase in the U.S. contribution temporary. That amendment, proposed by Rep. Jerry Lewis (R-Calif.), was defeated on a voice vote.

But the House approved another change to require the U.S. director of the IMF to vote against making loans to communist countries. That provision was approved, 242 to 185.

The legislation already prohibits such loans to countries practicing apartheid.

Several other amendments stemmed from complaints by opponents of the bill that it was a bail-out for large New York banks. One of the amendments accepted would limit the profit from fees charged by commercial banks when they restructure loans for IMF clients. Another would order the Treasury Department to determine the amount of profits banks may make on outstanding loans to borrowing countries.

"The prediction was that the bill was dead . . . a zombie," Rep. Fernand St Germain (D-R.I.), the chairman of the House Banking Committee who maneuvered the bill through the chamber, said last night. "We gave it a massive transfusion and then physical therapy. Thank God it came back to life."

"The administration was working very hard" to pass the bill, Rep. Byron L. Dorgan (D-N.D.) said before the vote. Dorgan said he opposed the bill and offered the amendment to limit bank profits. For "a lot of people who instinctively think this thing smells . . . the administration is getting these people to hold their noses and vote," Dorman said.

Rep. Phil Gramm (R-Texas) had proposed amending the legislation to prohibit the United States from voting for loans to communist countries, arguing that communist countries impede growth and loans to them violate goals of the IMF.

The House also amended the bill to prohibit banks from charging fees exceeding administration costs when restructuring international loans.

Another change would require the secretary of the Treasury to notify Congress at least 60 days before the IMF may borrow from U.S. private capital markets.

The additional assistance includes $5.8 billion for the regular U.S. share to the IMF, and $2.6 billion for a newly expanded emergency fund to help heavily indebted countries whose default might harm the international monetary system. The $8.4 billion would be part of a $32 billion increase that has been negotiated by the IMF's 146 member nations.

The IMF obtains money from its members and uses it to extend loans to nations with balance of payments problems if the recipient agrees to stringent domestic economic reforms.

After last night's vote, House minority leader Rep. Robert H. Michel (R-Ill.) said of the president's efforts: "He got mighty involved. He made it abundantly clear on a number of occasions how strongly he felt about it. My frustration . . . was we still only got a minority on my side supporting him." Michel didn't blame the president's lobbying abilities, but said, "it's just the basic issue" that the Republicans are voting against.

Rep. Kemp said he was "not happy or unhappy. I don't oppose an IMF facility dealing with those debt problems. I oppose the austerity the IMF is imposing on Third World countries and friends and allies."