For six months, Congress has been wrestling with the uncertainties of last year's Gramm-Rudman-Hollings budget-control law and hoping that agreement on a fiscal 1987 spending plan would put it on track for compliance with the law's stringent demands for deficit reduction.

Early yesterday, two months late, Congress finally adopted a budget resolution. It was passed with a collective sign of relief by both chambers as lawmakers scrambled to go home for a long Fourth of July recess and spread the word about the blow they had just struck for fiscal responsibility.

But, when Congress returns July 14, members are likely to find that the uncertainties -- including the critical question of whether Congress is really on track to meet the Gramm-Rudman-Hollings deficit target for next fiscal year -- are as great as ever.

The House and Senate will have only a month to implement the budget before the first "snapshot" of the fiscal 1987 budget is taken Aug. 15, marking the start of a two-month process under Gramm-Rudman-Hollings that could result in major across-the-board spending cuts on Oct. 15 if the promises of the budget are not fulfilled.

At stake are automatically imposed spending cutbacks required by the law if its deficit targets -- $144 billion for next year, declining to zero by 1991 -- are exceeded by $10 billion in any year. Relatively modest first-installment cutbacks earlier this year triggered disruptions that are still bedeviling Congress, and lawmakers do not even want to think about the fallout from larger cutbacks on the eve of this fall's elections.

The nearly $1 trillion budget for fiscal 1987 projects a deficit of $142.6 billion, or $1.4 billion less than the $144 billion target and $11.4 billion less than the deficit-plus-$10 billion level that would trigger the automatic cuts.

But, even before Congress headed home, there were dire warnings from budget experts that overly rosy economic assumptions, coupled with weak enforcement provisions for deficit reductions, could produce a much larger deficit than the budget resolution projects, possibly one large enough to trigger the cutbacks.

Senate Budget Committee member Ernest F. Hollings (D-S.C.), a coauthor of the new budget-control law, warned that the fiscal 1987 deficit is really on the order of $165 billion. House Budget Committee member Willis D. Gradison Jr. (R-Ohio) said chances of meeting the target are no better than "a 50-50 bet."

Neither Sen. Pete V. Domenici (R-N.M.) nor Rep. William H. Gray III (D-Pa.), chairmen of the Senate and House budget panels and principal authors of the budget compromise, could guarantee that it would meet the fiscal 1987 deficit target. Both sounded pessimistic but emphasized that passage of spending constraints in the budget would make any mandated cutbacks less Draconian.

The problem on the economic side is that revenues may be as much as $10 billion lower than anticipated, largely because of slow growth and low inflation. On the enforcement side, $9 billion of about $32 billion in new savings anticipated for next year would be locked in by "reconciliation" orders to committees for legislation to alter existing programs. In addition, some of the presumed savings are assumed by many to be exaggerated or virtually impossible to achieve.

Adding to these uncertainties is an expectation that, while Congress is gone, the Supreme Court will rule on the constitutionality of Gramm-Rudman-Hollings' automatic trigger for implementing the spending cuts. A lower court held it to be invalid, and if the high court agrees, Congress will be under orders from a fallback provision in the law to make the cuts itself.

Congress could squirm out of the predicament by changing or ignoring the law's sanctions, as it has did in the case of the measure's deadlines for compliance, including one that Congress waived so it could take a July Fourth recess.

But the political repercussions from such a blatant evasion could be high, especially for lawmakers who voted for Gramm-Rudman-Hollings last year when it was a noble abstraction and then turned their backs this year when it became a painful reality.

Another uncertainty is how the Reagan administration will respond to the budget's constraints on defense spending and its tacit offer of more military funds in exchange for a presidential request for tax increases.

In an initial response, presidential spokesman Larry Speakes said in Santa Barbara, Calif., where the president is vacationing, that the budget is "generally acceptable" although it "would alter the president's priorities."

Congressional budget leaders expect, however, that President Reagan will continue to push for defense increases through the authorization and appropriations process. He may use his veto leverage to increase defense spending at the expense of domestic programs, especially if all are wrapped into one omnibus "continuing resolution" at the end of the fiscal year Sept. 30.

At this stage, few if any lawmakers are willing to predict the outcome.