The stock market, buoyed just days ago by an apparent federal budget compromise, today closed a dismal week that saw the Dow Jones industrial average plummet more than 21 points.

The Dow closed the week at 788.62, its lowest point in more than two years, on fears that the long-awaited decline in interest rates is unlikely to occur soon. Short-term interest rates stayed high and, as a result, investors avoided both stocks and bonds.

"A lot of people thought the prime would come down soon," said Maury N. Harris, vice president and money market economist for Paine Webber Mitchell Hutchins, who predicts the prime will rise this summer from 16 1/2 percent to between 17 and 18 percent. "The banks are having to fund loan demand because people are borrowing to cover their borrowing," Harris said. "The recession is still on, and they can't cover their expenses."

The continuing increase in bank loans appears to be the key factor in Wall Street's struggle. Bank loans rose at a seasonally adjusted rate of close to 30 percent in April and May, and that demand is increasing, Wall Street economists say. "The cash flow is inadequate, and some people are borrowing just to keep their doors open," said Milton Ezrati, vice president and economist at Manufacturers Hanover Trust Co.

The problem is, however, that rates are unlikely to drop until the corporate cash picture improves, a trend that can occur only in concert with a broad economic upturn. A stock market recovery is likely only after those two events, analysts said.

As a result, declining stocks continued to dominate the New York Stock Exchange as 923 fell in per-share price and only 454 advanced. Volume rose to 54 million shares from 49.2 million shares yesterday, led by heavy trading in Cities Service, which jumped more than 15 points as a result of the Gulf Oil takeover offer.

The New York composite index closed at 61.74, down 0.22 point, with the average price per share down 0.09. Nine stocks hit new highs on the NYSE, while 176 hit new lows.

The American Stock Exchange index closed at 246.38, off 2.35 points, with volume up slightly on the Amex to 4.73 million shares. Shares on the Amex closed down an average of nine cents a share.

The over-the-counter markets were off, although not as sharply as the New York and American stock exchanges, with the composite NASDAQ index falling by 1.35 points.