The Democratic-controlled House yesterday narrowly approved a $480 billion catchall spending bill for the government that had drawn veto threats from the White House for favoring domestic spending over defense.

The so-called continuing resolution was approved on a largely party-line vote of 212 to 208 over Republican protests that it would invite a veto and possibly an impasse with the administration as Congress tries to adjourn for the year at the end of next week.

The close vote was attributed by members to the veto threats and to disputes over spending for agriculture and foreign aid.

The resolution is needed to fund departments and agencies for which Congress has yet to pass regular appropriations bills for the 1986 fiscal year that started Oct. 1. Congress has passed five of 13 appropriations bills, one of which, covering the Treasury Department and the U.S. Postal Service, was vetoed by President Reagan.

The measure, which is scheduled for action and probable revision today by the Senate Appropriations Committee, must be passed by Dec. 12 to avoid the closing of federal agencies. An earlier stopgap funding bill for the agencies expires that day.

At a meeting with Republican congressional leaders Tuesday, Reagan warned that he would veto the bill "if there is excessive spending in any area," meaning the whole bill will be vetoed if any of its major spending components exceed congressional budget targets.

In a further statement yesterday, the White House said the administration "strongly opposes" the House version of the bill and indicated it would be vetoed unless modifications are made to meet presidential objections.

In debate over the measure, House Appropriations Committee Chairman Jamie L. Whitten (D-Miss.) contended that the bill was within congressional budget allocations for domestic spending.

But the White House, using different yardsticks for measuring compliance, contended that the bill exceeded domestic targets by $2.6 billion, while falling short of the defense target by $9.7 billion.

In addition, administration officials objected to language added by Whitten to protect the income of farmers on grounds it would add $26 billion over the next three years to the cost of the farm bill recently passed by the House.

Republicans also objected to foreign aid provisions of the measure, contending they were included without going through usual procedures.

Meanwhile, a key figure in House-Senate negotiations over balanced-budget legislation warned that an agreement must be reached by the weekend to avoid another deadline crisis over passage of a debt-ceiling extension.

The provisions, aimed at eliminating annual budget deficits by fiscal 1991, are attached to a debt bill that must be enacted by Dec. 11 to avoid a financial default by the government.