Congress adjourned its history-making 1981 session of tax and budget cuts last night after passing a four-year farm bill, restoring the minimum Social Security benefit, revising the foreign aid program--and voting itself a Christmas present.

"We gave the president of the United States everything he wanted," lamented House Speaker Thomas P. O'Neill Jr. (D-Mass.) in an only somewhat exaggerated summary of President Reagan's impact on the first session of the 97th Congress.

Senate Majority Leader Howard H. Baker Jr. (R-Tenn.) called it "one of the most extraordinary Congresses in recent years," but Senate Minority Leader Robert C. Byrd (D-W.Va.) called it a "dismal" one that put the interests of the rich before those of the poor. "Successes like this can be the undoing of the country," he said.

The last major piece of legislation to be acted on was the administration-backed farm bill, which was barely passed 205 to 203 in a cliffhanger in the Democratic House.[Details on Page A5]

Earlier in the rush to go home:

* House and Senate sent President Reagan a bill increasing the tax deductions members of Congress can take; it will let them deduct as business expenses the costs of maintaining second homes here when they also have homes in their districts.[Details on Page A7]

* Prospects improved for extension of the Voting Rights Act next year as Sens. Edward M. Kennedy (D-Mass.) and Charles McC. Mathias Jr. (R-Md.) claimed 61 co-sponsors for approval of the strongly worded House-passed version, enough to break a filibuster if one develops. Their list included seven Republican committee chairmen and several southern Democrats.[Details on Page A4]

* A proposed constitutional amendment to give both states and Congress the right to restrict or ban abortions was approved, 4 to 0, by a Senate Judiciary subcommittee. Chairman Orrin G. Hatch (R-Utah), sponsor of the amendment, said he anticipates floor action within a few months.[Details on Page A6]

* The House briefly balked at adjournment to take up and pass, 223 to 107, a bill aimed at barring Mobil Oil from taking over Marathon during the next six months. But the Senate, lacking unanimous consent to bring up the bill, gave up and quit even before the House acted, preventing enactment at least until after Congress reconvenes next year.[Details on Page A7]

* Legislation to replenish the fund for coal miners' black lung benefits by doubling the tax on coal while tightening eligibility rules was approved by both houses.

Both houses approved up to $8.2 billion in highway aid, as Reagan requested, and authorized $2.4 billion in sewer grant spending along cost-cutting lines that Reagan demanded.

* The Senate put off action on legislation making it a crime to disclose names of intelligence agents when opponents, claiming the measure violated constitutional guarantees of free speech, threatened to talk it to death.

The congressional recess is to last about six weeks. Congress is scheduled to return Jan. 25 and will hear Reagan's 1982 State of the Union address the following day, to be followed shortly by his budget message for the 1983 fiscal year.

Final action restoring the $122-a-month minimum Social Security benefit gave the Democrats one of their rare victories of the session, although Social Security financing will return to haunt Congress again next year.

The House, following similar action by the Senate on Tuesday, voted 412 to 10 to approve the measure, which restores the benefit for all people who qualify for it by the end of this year and permits stopgap borrowing to keep the Social Security retirement fund afloat through the end of 1982.

Congress had previously voted to kill the benefit at the behest of Reagan, but changed its mind in response to public protest and Democratic politicking on the issue. The benefit is currently paid to about 3 million people whose Social Security contributions would otherwise qualify them for lower amounts.

"Hallelujah, praise the Lord and Amen," said Rep. J. J. Pickle (D-Tex.), chairman of the Ways and Means subcommittee on Social Security, as it appeared that the minimum benefit controversy was finally ended. But Rep. Barber B. Conable Jr. (R-N.Y.), ranking Republican on Ways and Means, warned that the action "solves nothing but the immediate problem of the minimum benefit."

Final action on the foreign aid package came as the Senate approved a conference report on the $11.5 billion appropriation for 1982, the first time the money bill has gone all the way through Congress since 1979. The Senate vote was 55 to 34.

Earlier in the day the House had endorsed both authorization and appropriations bills, and the Senate had approved the foreign aid authorization bill on Tuesday night.

Approval of the foreign aid money bill means that Congress has passed and sent to Reagan 10 of its 13 regular appropriations bills for the fiscal year that started last October, leaving a half dozen major domestic departments to be funded by the continuing resolution that Reagan signed earlier in the week.

A final change in the House-Senate conference on the money bill softened language dealing with abortion in the aid programs. A House-passed amendment had banned lobbying, promoting, recommending or training people to perform abortions in carrying out U.S. aid programs overseas. The final version prohibits only lobbying.

The appropriations measure also further reduced the U.S. contribution in 1982 for the International Development Association (IDA), the soft-loan arm of the World Bank, from $725 million to $700 million. The administration had requested $850 million, but strong opposition to IDA's non-interest bearing loans gradually whittled the total down in the past two weeks of debate.

The legislation provides $965 million for security assistance, $1.5 billion for multilateral asssistance to poor countries, $4.4 billion in bilateral aid, $700 million for the Peace Corps and other agencies and $4 billion in new limits on loans and guarantees by the Export-Import Bank.

There was little debate in the House and none in the Senate, although some House members complained about voting new aid for Israel in the wake of that country's annexation of the Golan Heights. Rep. Paul N. McCloskey Jr. (R-Calif.) warned that support of Israel may be drawing the United States into a Middle East war and said Israel should be told: "This is the limit."

The House vote was close--217 to 201--on the appropriations bill, showing that foreign aid is still unpopular, in that chamber at least, in a year of domestic budget cuts.