After four days of partisan squabbling over President Reagan's proposed budget cuts, the nation's big-city mayors wound up their annual meeting here today by adopting resolutions that grudgingly accepted most of the major elements of the administration's "economic recovery" program.

Apprehensive that the cuts in federal aid to cities will force them to lay off workers and reduce services, the members of the U.S. Conference of Mayors showed themselves, nevertheless, to be unwilling to take on a popular president.

They went along with the key elements of Reagan's tax proposals and suggested that cuts in some urban programs be "examined," but took great care not to be begging for restoration of funds. They did, however, ask that Congress and the administration begin giving domestic spending "parity" with the military budget. They went to great lengths to scrub language that might make them appear weak on national security.

Preferring to continue their direct relationship with Washington, they steadfastly resisted efforts by administration spokesmen to get them to endorse Reagan's proposals for consolidating categorical federal aid into block grants controlled by governors and by rural- and suburban-dominated legislatures.

The annual mayors' meeting, dominated by Democrats from the industrial North who had been the bedrock of Jimmy Carter's support, was treated with polite disdain and mild apprehension by the White House.

Amid concern that the conference would be among the first to break the consensus of support for the president's economic programs, only Housing and Urban Development Seretary Samuel R. Pierce Jr. accepted the invitation to Cabinet officials. Reagan met with several groups of mayors in the past two weeks at the White House but he, Vice President Bush and others declined their invitations. After turning down the mayors, Interior Secretary James G. Watt turned up here in Louisville to speak to hunting and fishing columnists.

The mild tone of today's resolutions appeared to surprise young GOP and White House aides on their first excursion to a mayors' conference.

"We thought we were going to get nailed," said Ed Locke, of the Republican National Committee, who professed to be amazed at the outcome.

The White House had been particularly upset with the stinging attacks on the "economic recovery" program by conference president Richard G. Hatcher, mayor of Gary, Ind., and vice chairman of the Democratic National Committee. Hatcher was frozen out of Reagan's meetings with mayors after he compared the cuts to the murder of a Queens, N.Y., woman, Kitty Genovese, who was slain as neighbors did nothing.

In one of the last acts before adjourning, Republicans attempted to censure Hatcher, an unprecedented move in an organization that tries to subordinate partisan politics.

After brawling over the Reagan economic issues, the mayors turned to partisan bickering. Angered that the Democratic leadership has arranged that there will be no Republican in a top conference office for at least two years, Republicans waged a bitter floor fight.

Noting that blacks and a woman filled the top offices now, GOP Mayor George Sullivan of Anchorage tried to push liberal Republican Mayor Hernan Padilla of San Juan, Puerto Rico, for a leadership post. Sullivan said that two other minorities -- Hispanics and Republicans -- were still shut out.

The reason for the mildness of the final resolutions was that most Democrats had no taste for taking on Reagan, because they are caught in the dilemma of their own concern about cuts and voters' fervent hope that Reagan's sharp cure for the faltering economy will succeed.

One Democratic mayor, Dan Whitehurst of Fresno, said privately, "We have to be concerned that we don't end up looking like the ones who want to turn back the clock."

John P Rousakis, the moderate mayor of Savannah, Ga., said he would be criticized at home for some of the muted questions he had raised publicly about the cuts.

"Reagan has promised change," he said, and his constituents are "ready for change at any cots until they start feeling the impact of that change and then it will turn again."

A mood both melancholy and desultory hung over the conference. Without the usual round of Cabinet speakers, the schedule was filled with a round of parties. General Electric raffled off stoves and refrigerators for mayors at one cocktail hour. On another afternoon several buses took them to Churchill Downs to bet the horses; there was nothing else on the schedule.