Gilbert Hahn Jr. resigned as chairman of the D.C. General Hospital Commission yesterday in the wake of harsh criticisms by Mayor Marion Barry and City Council member Polly Shackleton over the commission's budget requests for the hospital.

The criticism last week "reflects such a lack of confidence in my judgment . . . I think they will be happier with somebody new there," Hahn said in an interview.

"I'm not angry at anybody," added Hahn, a former chairman of the D.C. City Council.

The hospital commission last week asked Barry and the City Council for a total $4.2 million subsidy for fiscal years 1983 and 1984 and, at the same time, released a report on its budget prepared by the accounting firm of Peat, Marwick, Mitchell & Co.

Barry and Shackleton said the Peat, Marwick study offered concrete suggestions that would save the hospital millions of dollars and charged that the commission did not fully consider them before requesting the city subsidy.

Barry last week refused to give the hospital the added funds, saying in a letter to Hahn that he found it "truly incredible" that the hospital is insisting that more are necessary.

The city already has increased its fiscal 1983 subsidy to the hospital to $39.1 million because of the large projected deficit it was facing earlier this year.

Last January the commission predicted a $31 million budget deficit and voted to close the hospital on July 1 if the deficit was not eliminated. The hospital took several cost-cutting measures and the city put in an additional $12 million for this fiscal year and next.

According to hospital officials, there is still a projected deficit of $10.5 million, and the hospital hired the accounting firm to look for new ways to close it. They said that the 4.2 million request for additional subsidies was in addition to $6 million in savings through administrative and legislative changes that the hospital proposed to the City Council last week.

Shackleton said that neither she nor the mayor was ever convinced that the hospital ever really had a deficit of $31 million to begin with.

Hahn yesterday had two letters hand-delivered to Barry with copies sent to Shackleton, one commenting on last week's criticisms of the hospital budget and the other tendering his resignation.

"I am afraid neither your staff nor Ms. Shackleton's understood Peat Marwick's and our reports," the first letter stated.

"There are possibly two or three million dollars in savings that can be made in fiscal year 1984, by two or three initiatives--not all of them good ideas for the city," Hahn wrote in his letter. This would still leave a budget deficit of $7 or $8 million that year, he said.

In his letter of resignation, Hahn noted that his term ended 18 months ago but that he has remained as chairman while Barry looked for a replacement. He said that he would ask the commission to name Marilou King as acting chairman.

Hahn thanked the mayor for allowing him "to do this interesting work for the city for most of the past five years and to tell you that it was a pleasure working with you--even now."