RECESSIONS COME in various shapes and sizes, but the one now engulfing the United States is unusually hard for economists to gauge.

Although there is no remaining doubt that the U.S. economy began to shrink over the past few months, the depth and extent of the first downturn in eight years will depend on one major unknown: What happens in the Persian Gulf.A prolonged war that damages oil-production facilities could send oil prices skyrocketing, which would drain U.S. economic resources, further undermine the confidence of consumers and investors and, probably, deepen and stretch out a recession.

If war is avoided or is over quickly with the United States the clear victor, oil prices could tumble and the economy could move ahead again, regaining at least part of its luster.

But the Persian Gulf confrontation is not the only uncertainty making 1991 the hardest year in memory for economists to forecast.

Their predicament is compounded by the crisis embroiling U.S. banks, a linchpin for the nation's economy. Not since the 1930s has there been a recession closely linked to the plight of financial institutions.

Their books riddled with unpaid loans and their capital stretched thin, gun-shy banks are unlikely to fulfill their past role in propping up the economy, regardless of persistent efforts by the Federal Reserve Board to lower interest rates.

Despite these unpredictable elements, most economists are cautiously predicting that, without a long war, the economy will pull out of the recession by midyear - although only fitfully.

Even after recovery gets under way, however, it may be hard to tell the difference between the upturn and the preceding slump.

"The next six months are going to be weak ones, but we may see a moderate recovery in the second half of the year," said David Hale, chief economist for Chicago-based Kemper Financial Services. "If there is a war and it is over quickly, it should have only a modest effect on the economy."

The statistics pouring from the government mills over recent months point to "a serious decline," said Irwin Kellner, chief economist at Manufacturers Hanover Bank in New York, but he said that it might turn out to be only "about average in severity."

Paul W. Boltz, vice president and financial economist at T. Rowe Price Associates, predicted "a short and sour recession" ending this summer.

Economists said that there are several forces at work that should soften the blow, despite the banking troubles and the continuing savings and loan crisis:

-The relatively low inflation rate gives the Federal Reserve Board greater latitude in lowering interest rates without fear of sending prices spiraling again. Many economists expect interest rates to decline by a percentage point or more in the first half of the year.

-Companies using sophisticated computers have kept tight controls over inventories so that slumping sales should not trigger major production cutbacks, a prime cause of past recessions. Auto companies are planning increases in production in the current quarter that could generate some recovery.

-The steep slide in the dollar over the past year should buttress exports, which shot up in October in the midst of the unfolding recession. The stronger economies in Japan and Germany are buoying these foreign sales.

-The five-year decline in homebuilding should be bringing that industry close to the bottom, ready for a rebound.

-The government reported last week that sales of new homes rose in November for the first time in five months. Also, a consensus of 63 economists polled in December by the Livingston Survey said that housing construction would rise at a 9 percent annual rate through June and probably accelerate after that.

-Fiscal policy, including a deficit of more than $250 billion this year, and spending on Operation Desert Shield should help stimulate the economy.

The official arbiter of recessions, a seven-member committee of prominent economists at the National Bureau of Economic Research, estimates that the recession probably began between June and September, the latter coinciding with Iraq's invasion and occupation of Kuwait, which caused oil prices to soar and consumers to tighten their belts.

On that basis, since most economists are predicting a recession of average length - which means about a year - the economy should be slowly bottoming out by summer.

Nonetheless, despite a possible midyear turnaround, 1991 is expected to be a bumpy year for the economy regardless of what happens in the Middle East, according to most experts.

The consensus forecast of 52 economists surveyed by Blue Chip Economic Indicators in mid-December said that the U.S. economy would expand at a rate of only 0.3 percent from the fourth quarter of 1990 to the fourth quarter of 1991. Almost half of those surveyed projected no growth or a contraction.

Problems abound for the economy after the huge debt piled up by Washington in the 1980s and heavy borrowing by many individuals and businesses.