The Corcoran Gallery of Art has successfully completed a fund-raising campaign that - in just four months - has brought the institution more than $500,000.

The city's oldest art museum, which half a dozen years ago was swiftly going broke, seems to have returned to financial health.

"In 1971 we figured we had just six years before operating deficits ate up out endowment,' said David Lloyd Kreeger, president of the board. "I'm pleased those days are over." With a 20-fold increase in annual contributions - and reduced expenses - the Corcoran, said Kreeger, already has begun to replenish its endowment.

The figures are impressive. In 1971-1972, for instance contributions totaled $45,000. For 1976-1977, the comparable sum will be more than $1 million, Kreeger said.

The Corcoran last June announced it had to raised $295,000 by Aug. 31 to meet a deadline set by the Gwendolyn Cafritz Foundation and the Ford Foundation.

The Ford Foundation had offered the Corcoran School of Art $127,750, on the condition that that sum be matched, in cash, by the end of August. "Had we raised only $125,000, we would have lost the whole Ford grant," said acting director and chief executive officer Gilbert H. Kinney.

The Cafritz Foundation, which offered the gallery $100,000 set terms just as stringent. The Corcoran had to raise $200,000 in "new money" to qualify for the funds. "That meant that if somebody gave us $5,000 last year, and $6,000 this , we could only use the 'new' $1,000 to match the Cafritz grant," said Kinney.

The Corcoran, this summer, has raised enough to qualify for both matching grants.Kinney said that $255,000, half of it from Ford, will be used for school scholarships, fellowships, faculty programs and experimental workshops. The matching of the Cafritz grant will add $300,000 to the Corcoran $3.5-million endowment.

Of the $313,000 raised this summer, $150,000 came from Corcoran trustees. (The board, this year, said Kinney, will give the institution a total of $250,000.) Local banks, corporations, foundations, individuals, and the Friends of the Corcoran (which gave $68,000) provided the rest. Kreeger said that Kinney, trustee B. Francis Saul II, and consultant James B. Maxwell, formerly the National Symphony's development officer, were "primarily responsible" for the campaign's success.