President Reagan won one of the most dramatic legislative victories of any recent presidency last night as the Democratic House of Representatives bowed to his will and approved more than $35 billion in spending cuts, many from long-cherished Democratic programs.

Voting 217 to 211, with conservative Democrats again providing the margin of victory, the House approved more than $5 billion in program-slashing revisions that Reagan wanted beyond the unprecedented package of spending reductions already approved earlier by House committees.

Republicans estimated the total savings at $38.2 billion for next year and at least $145 billion over the next three years, roughly the same blueprint for budget retrenchment that the Republican-controlled Senate approved with less suspense and acrimony Thursday night. The two versions will go to a House-Senate conference committee to resolve the differences after next week's July 4 recess.

The cuts approved by House committees, as deepened by the Republican proposals, would slash more than 250 domestic programs. Only defense spending, which will be increased dramatically under Reagan's program, was shielded from the budget ax.

The Republican proposals meant even deeper cuts than proposed by the committees in major programs such as food stamps, subsidized housing, child nutrition, federal workers' pay and pensions, and welfare.

They also assured some version of Reagan's plan for consolidating many federal programs into block grants to the states, already approved in modified form by the Senate. Only GOP-proposed energy revisions and a "cap" on Medicaid spending fell by the wayside for lack of votes.

It was Reagan's second big victory in the House in as many days. On Thursday the House rejected a Democratic divide-and-conquer procedural strategy to pick apart his program in separate votes rather than give him the one up-or-down vote that he won yesterday.

In winning, Reagan and his budget director David A. Stockman, exploited a little-used congressional budget process called "reconciliation," which enabled them to put their spending cuts on a fast, smooth track that bypassed the traditional power structure and its normally well-placed traps for executive initiatives.

Reagan, resting at his California home, greeted the vote as a "major victory in the war against inflation," and called it a "profile in political courage" that "should inspire the gratitude of us all."

On the climactic vote yesterday, following nearly five hours of tense and acrimonious debate, the president picked up the votes of 29 Democrats and lost only two Republicans, despite an all-out, high-pitched effort by Democratic leaders to characterize the whole process as a "shameful charade of a legislative process gone mad," as House Budget Committee Chairman James R. Jones (D-Okla.) put it.

Most of the Democratic defectors were conservative southerners who had helped Reagan win his earlier budget victories and can apparently be counted on to give the Republicans effective control of the House, at least on major budget issues. The two Republicans who switched to vote with the Democratics were Reps. Claudine Schneider (R.I.) and Charles F. Dougherty (Pa.).

Even some Republicans conceded that the tumultuous process by which the budget savings were approved was untidy at best, with copies of their roughly 1,000-page proposal getting to members' desks only after the debate had started yesterday, containing errors that will have to be corrected in conference.

But it was clear that the House, or at least a bare majority of it, was ready to follow Reagan to the limits of his budget-slashing plans, regardless of the circumstances.

So firm was the president's grip on that majority that Democratics failed even in a last-ditch effort to sweeten the package by targeting selected restorations of money to Social Security recipients, government pensioners, agricultural research stations and students.

Democrats kept the roll call going long past its time so stragglers could get to the chamber, but it didn't work. They lost, 215 to 212.

It was almost anti-climactic when the reconciliation bill passed, 232 to 193. As the vanquished general, Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.), supplied the battle's final commentary. Recognizing Minority Leader Robert H. Michel (R-Ill.) as a matter of routine at the session's end, he referred, intentionally or otherwise, to him as the "majority leader." Republicans cheered, Democrats winced.

Throughout the day of rancorous, even boisterous debate, Democrats accused the Republicans of trying to foist off on the House a hurriedly assembled, deceptive package containing what O'Neill called a "hidden agenda" for the wealthy.

"That hidden agenda is a deliberate effort to transfer wealth from the struggling families of this country and award that wealth to those who are already wealthy," O'Neill said in a statement read before the session started.

Others were even more acerbic.

"Democracy is on the line with this vote," claimed Rep. Leon E. Panetta (D-Calif.), who headed the budget reconciliation effort for the Democrats. Holding up a copy of the Republicans' proposal, Rep. Elliott H. Levitas (D-ga.), who supported Reagan in setting budget targets last month, asserted: "It's the 1981 edition of the Book of the Dead." "A brazen attempt at a power grab," charged Majority Leader James C. Wright D-Tex.).

Republicans and their chief Democratic ally, Rep. Phil Gramm (D-tex.), acknowledged that the proposal was hastily put together and conceded the whole process left much to be desired. But they claimed it was a historic, make-or-break opportunity to bring the federal budget under control for future years as well as the present.

"We have the American people behind us. They recognize there is a crisis," said Gramm, who, with Rep. Delbert L. Latta (R-Ohio) cosponsored the president's proposals. "If we don't get the job done today, when the American people are behind us, we're not going to get it done," added Gramm.

But some Republicans expressed concern nonetheless. "This is confrontation and maneuver of a highly political nature," noted Rep. Barber B. Conable Jr. (R-N.Y.). "I have to be concerned about procedures that force us to make a decision in this environment."

At one point O'Neill and Michel engaged in a rare shouting match over Democratic attempts to get a copy of the Republican proposal Thursday night before it was sent to the printers.

"Outrageous," claimed Michel, suggesting "dirty tricks." Brushing aside the charge, O'Neill attacked the Republican proposal, saying, "This is such a mish-mash, Bob, that you ought to call it off the floor."

There were also suggestions from Democratic leaders that Democratic defectors might rethink their party credentials. In an apparent reference to Gramm and others, O'Neill said, "In decency, some of those fellows out there should excuse themselves from the Democratic caucus." But he said he would not attempt disciplinary proceedings against them.

Washington area members voted along party lines, with only Rep. Michael Barnes (D-Md.) voting against the president's proposals.

These were some of the major choices the House faced in deciding whether to override its committees by reworking their proposals to accommodate the Reagan-Stockman push for total victory:

Food stamps. The Democrats proposed "capping" food-stamp spending to save $1.5 billion next year. Contending that the cap would be ineffective without eligibility and benefit changes, the Republicans proposed to save somewhat more by tightening the former and changing the basis for determining the latter. The GOP proposal called for dropping recipients whose income exceeds 130 percent of the poverty level.

Student loans. The Republicans proposed a means test to limit loans to those who can establish need, affecting 1 million or more college students. The committees' proposal continued the current practice of providing loans without regard to income.

Subsidized housing. The Democrats moved to limit the number of new units to 176,000; the Republicans 162,000. Both proposals are a far cry from former president Carter's plan for 250,000 new units. The Republicans also moved to make tenants to pay more of their income for rent, increasing the percentage from 25 percent to 30 percent over the next five years.

Federal pay. The committess proposed a pay increase of 5.8 percent next year; the Republicans, 4.8 percent. The Republicans called for dropping one of two cost-of-living increases that federal retirees receive each year, while the committees called for an end to "double-dipping" under which military retirees who take civilian government jobs continue to receive dual compensation.

Impact aid. Both versions sought to cut by half the program of aid to school districts serving government employes, but the Republicans would target what's left more toward districts serving big military installations.

Social Security. The committess proposed to delay next year's cost-of-living adjustment from July to October; the Republicans moved to eliminate the $122 monthly minimum Social Security benefit next April.

School lunches. Both contemplated cuts; the committees, 20 percent, the Republicans, 30 percent.

Welfare and Medicaid. The Republicans proposed deeper cuts than the committees in aid to welfare mothers, including giving states greater leeway to require work in exchange for benefits and banning aid to strikers. The Republicans also pushed, unsuccessfully, to cut more deeply into Medicaid by putting a "cap" on payments to the states and giving states more flexibility in cutting benefits.

Export-Import Bank. The committees proposed big cuts in credit for U.S. exporting firms, while the Republicans did not.

Clinch River breeder reactor. The committees would halt its development, while the Republicans would continue support.

Block grants. The committees rejected almost all of Reagan's block-grant proposals, while the Republicans included them in somewhat modified form, refusing to go as far as Reagan wanted in consolidating some big programs, like school aid for poor children, into the grants to states.