The Senate gave final congressional approval yesterday to a Republican-drafted budget for fiscal 1983 that would raise taxes, cut domestic spending for the second year in a row while slightly trimming the administration's huge military buildup program and still produce a record deficit target of more than $100 billion.

Then the Senate also joined the House in extending the federal debt ceiling to $1.143 trillion, an increase of $63.3 billion, to keep the government running until the start of the 1983 fiscal year on Oct. 1. Only a few Democrats voted for the measure, forcing Republicans to take the lead in passing it as a kind of penitence for years of campaigning against Democrats on the debt issue.

The Senate's vote on the debt bill, which had already been approved by the House as part of the budget, was 49 to 41. Still pending for action later this summer is an even bigger debt extension measure to carry the government to the end of the 1983 fiscal year, which is expected to become the vehicle for a variety of conservative issues.

On the budget, the vote of 54-to-45 to approve a House-Senate conferees' compromise followed five months of extraordinary haggling that produced a budget that seemed to please almost no one--except to the extent that the ordeal, or at least the first round of the ordeal, was finally over.

"It seemed it would never end," conceded Senate Budget Committee Chairman Pete V. Domenici (R-N.M.), who characterized the budget marathon as having turned out "reasonably well . . . under the circumstances."

Congressional completion of the budget was promptly hailed by President Reagan, who embraced congressional Republicans' efforts to write a budget after his own budget plan was scuttled almost from the start.

Reagan, who called wavering Senate conservatives on the telephone during the day to marshal support for the Republicans' budget, said it "recommits this government to a clear course toward lower growth of spending, steadily declining deficits and eventually the ability to live again within our means."

But he said "even steeper hurdles remain" as Congress tries to enforce its new budget targets through legislation to increase taxes and cut spending.

The $769.8 billion budget for the fiscal year starting Oct. 1 calls for nearly $80 billion in deficit reduction measures, including $22 billion in tax and user fee increases, about $14 billion in domestic program cuts, $7.6 billion in defense savings, $13.6 billion in "management savings" that the administration would have to make and $14.5 billion in reduced interest costs.

Assuming that these savings are made, the deficit for next year would be $103.9 billion, declining to $60 billion by 1985.

But the nonpartisan Congressional Budget Office, disputing some of the budget's assumptions, has calculated the 1983 deficit at $116.4 billion and the 1985 deficit at $92.7 billion, prompting charges of political gamesmanship from the Democrats.

As the final vote neared in the Senate, the chamber was nearly empty as Domenici and Sen. Ernest F. Hollings (S.C.), ranking Democrat on the Budget Committee, argued over the merits of the budget, agreeing only that it would be difficult to enforce.

"You have a political document here that can't stand the light of implementation . . . . You won't have the votes" to carry it out, claimed Hollings.

While the budget will be "difficult to implement," Congress will have "no apologies to make" if it meets its targets, Domenici responded.

"If the numbers are off," he told reporters after the vote, "it's going to be because Congress didn't do what it was supposed to do" in enacting the actual legislation that is required to meet the budget targets.

Under the budget, congressional committees are ordered over the next six weeks to come up with $20.9 billion in tax and user fee increases and $6.6 billion in spending cuts for next year. The rest of the savings is to be made through the regular authorizing and appropriating process, requiring Congress to waive budget restrictions if the targets are exceeded.

There is widespread skepticism about whether the savings will be achieved, which Domenici cited yesterday as a reason why financial markets cannot be expected to respond immediately to passage of the budget. "At this point they are still skeptical about whether they the deficits are going to come down," he told reporters.

Domenici said he would keep prodding Congress to meet the targets and urge Reagan to do the same. But, in the meantime, he had to smooth some ruffled feathers on the Senate Appropriations Committee by assuring the panel it would not have to trim its money bills to take into account unexpected increases in spending for benefit programs. The result could be an increase in the deficit.

While the nine-vote margin in the Republican-controlled Senate was a comfortable one, the unexpectedly close House vote of 210-to-208 on Tuesday contributed to the skepticism about whether the budget will be carried out.

Moreover, House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) has served notice that Republicans will have to take the lead in making up for any tax and spending savings shortfalls from the committees.

The Senate vote was largely along party lines. The only Republicans who voted against the budget compromise were Jesse Helms (N.C.), Charles McC. Mathias Jr. (Md.) and Lowell P. Weicker Jr. (Conn.). The only Democrats who voted for it were Howell Heflin (Ala.), John C. Stennis (Miss.) and Edward Zorinsky (Neb.).

The domestic spending cuts come on top of deep cuts made last year by Congress at Reagan's behest. With some exceptions, domestic appropriations would generally be frozen at 1982 levels.

In addition, most benefit entitlement programs, with the exception of Social Security, would receive some cutbacks--up to as much as $3.6 billion for Medicare alone next year. Cost-of-living increases for federal workers' pay and pensions would be limited to 4 percent.