A recess-bound Senate approved urgent legislation last night to raise the federal debt ceiling to $1.39 trillion after a brief but tense impasse during which Democrats threatened to hold it hostage to force a vote next month on their proposal to put an income ceiling on the July tax cut.

The vote on debt-ceiling extension was 51 to 41. Democrats relented and agreed to the vote after winning assurances from House and Senate leaders that they will be given another crack at the tax cut before it takes effect July 1.

Yesterday's Senate impasse followed by six days the end of a bitter stalemate over the fiscal 1984 budget that was broken with passage, 50 to 49, of a bipartisan tax and spending plan.

The critical issue was the same yesterday: taxes.

But this time the Senate was facing a deadline of next Tuesday, when the Treasury Department says it will bump into the current debt ceiling of $1.29 trillion and run out of borrowing authority unless Congress raises the ceiling.

Without a debt ceiling extension by then, "this government will stop dead in its tracks at midnight on the 31st day of May," Majority Leader Howard H. Baker Jr. (R-Tenn.) warned as he threatened to hold the Senate in session through the planned Memorial Day recess, if necessary, to gain passage of the debt measure.

The debt bill, as passed by the House last week on a voice vote, would raise the ceiling by $99 billion to $1.39 trillion, enough to last through the end of the fiscal year Sept. 30. A majority of Senate Democrats decided to push for a shorter extension that would require another debt bill shortly before the tax cut takes effect, giving them a vehicle for their proposal to cap the tax cut savings at $700.

But Baker said House leaders of both parties had told him that the House, always skittish about the political implications of raising the debt ceiling, would probably not approve the change. That would have meant congressional deadlock over the debt extension and delay in the start of senators' week-long holiday recess.

So, after House Democratic leaders assured Senate Democrats they would provide some legislative vehicle next month for the proposed tax cut cap, and Baker agreed not to block it, the Democrats allowed passage of the longer extension. President Reagan is expected to sign the measure.

All Maryland and Virginia senators, except Charles McC. Mathias Jr. (R-Md.), voted against the debt-ceiling extension.

As the Senate struggled, the House approved, 309 to 92, a $4.8 billion supplemental appropriations bill that included, as a rider, a provision to limit senators' outside income by about $18,000.

House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) had denounced it as a breach of faith with the Senate, which last year approved a salary increase for House members in exchange for a lifting of earlier limits on senators' outside income from speechmaking and other activities.

The House vote came in reaction to recent financial disclosure reports showing that at least 15 senators earned $50,000 or more last year from speeches, mostly to special-interest groups.

Some senators have reportedly suggesting repealing House members' pay increase in retaliation. The Senate Appropriations Committee is scheduled today to take up the bill, which also includes a ban on leasing of government coal reserves. Most of the money in the bill provides is to continue funding many mandatory government programs through the rest of the fiscal year.

In approving the appropriation measure, the House rejected two bids to reduce or eliminate $454 million to continue production of the Pershing II intermediate-range missile, scheduled for December deployment in Europe. It also added $12 million for increased research on acquired immune deficiency syndrome (AIDS), a deadly new disease. Meanwhile, House and Senate leaders decided to wait until after the recess to tackle differences over the fiscal 1984 budget, conceding that issues dividing them are "formidable."

"We're all committed to do our best to get a budget resolution," House Budget Committee Chairman James R. Jones (D-Okla.) said after a brief meeting in which ranking members of both chambers' budget panels agreed on little more than a pledge to try getting a budget accord.