House and Senate negotiators failed to reach an agreement last night on legislation to revitalize the Gramm-Rudman-Hollings budget-balancing law, stumbling over how long to keep in effect a new mechanism designed to automatically cut spending if Congress and the administration fail to reach their deficit targets.

"It's basically come down to an impasse," said Sen. Pete V. Domenici (R-N.M.), the ranking minority member of the Senate Budget Committee.

The conference committee, working under the twin pressures of a Friday expiration of the federal debt limit and the congressional recess also scheduled to begin Friday, resumes deliberations this morning.

It appeared that daylong meetings yesterday would resurrect the deficit-reduction law through an amendment to an extension of the debt limit. Conferees appeared to be heading toward compromise over new deficit targets and a new provision for automatic spending cuts.

The goal of the conference is to produce a new set of deficit targets and a spending-cut provision to replace the one in the original balanced-budget law that was struck down on constitutional grounds by the Supreme Court last year.

But House negotiators led by Ways and Means Committee Chairman Dan Rostenkowski (D-Ill.) insisted that any new automatic spending-cut provision be in force for two years, through the next presidential election.

Senate conferees rejected that proposal, insisting that the mechanism that "triggers" the automatic, across-the-board spending cuts carry beyond the end of the Reagan administration.

Sen. Phil Gramm (R-Tex.) called the House position a "show-stopper" and said he and his colleagues would not agree to any provision that would mandate automatic cuts only during Reagan's presidency.

House negotiators in turn accused Republican senators of pushing for new deficit targets that are so low they would result in little or no significant reductions in the huge federal deficit until Reagan has left office.

"We are trying for tougher targets, they are for no targets," said one member of the House negotiating team. "It's clear they want to protect Reagan. They don't want any deficit reduction until 1990."

Nonetheless, the conference was making progress towards establishing new deficit targets to replace the existing goals that are universally regarded as unachievable.

When the conference broke up last night, negotiators were discussing a proposal that would require $20 billion in deficit reductions in fiscal 1988, the federal spending year that begins Oct. 1, and a maximum of $36 billion the following year. The House appeared willing to accept that, with the proviso that no asset sales or other accounting gimmicks be counted toward the first year's $20 billion.

Under the current Gramm-Rudman-Hollings law, the federal deficit is to be reduced next year to $108 billion. If the law is amended to require $20 billion in reductions next year, it would leave the federal deficit in the neighborhood of $150 billion.

The conference has agreed to an extension of the debt limit to May 1989, settling on a ceiling of $2.8 trillion. The current debt limit of $2.3 trillion expires tonight and reverts back to $2.1 trillion. The Treasury Department estimates that the U.S. financial position will not become precarious until about Aug. 13.

But with Congress headed for its annual August recess on Friday, negotiators must reach an agreement on the long-term extension of the debt ceiling and the balanced-budget law today or tomorrow, or pass a temporary extension of the borrowing ceiling that would carry the government into September -- as it did last week.

Rep. William H. Gray III (D-Pa.), the chairman of the House Budget Committee said that there is still a chance for a breakthrough. "Maybe a night's sleep will refresh us all and we will come back re-invigorated," he said.