After four years of activity that helped topple a President and sent several of his top aides to prison, the Watergate special prosecutor's office will go out of business in mid-June.

The current special prosecutor, Charles F. C. Ruff, announced yesterday that his office will be disbanded because the Supreme Court has closed the books on the last of the major Watergate prosecution cases.

On Monday, the court refused to review the convictions, on charges related to the Watergate burglary and cover-up, of former Attorney General John N. Mitchell and former Nixon White House assistants H. R. (Bob) Haldeman and John D. Ehrlichman.

Although the special prosecutor's office still has some minor unfinished business, Ruff said he and Attorney General Griffin B. Bell have agreed that these matters can be transferred to the Justice Department for disposition.

The voluminous files compiled by the office will be placed in the National Archives, Ruff said. Justice Department sources said details of how the files will be handled are still being worked out; but, the sources added, the expectation is that the public will be given at least limited access to them under the provisions of the Freedom of Information Act.

Ruff, who is expected to be named deputy inspector general of the Department of Health, Education and Welfare, was the fourth man to head the prosecution force whose investigative activities had a role in the 1974 resignation of President Nixon.

Former Attorney General Elliot L. Richardson set up the special prosecutor's office on May 31, 1973, to quell suspicions that the Justice Department was unable to properly investigate the 1972 break-in at the Democratic National Committee's Watergate headquarters.The office's mandate was to probe the burglary and other crimes connected with the 1972 presidential election.

Five months later, Nixon ordered the first Watergate special prosecutor, Archibald Cox, fired - an action that led to Richardson's resignation and provoked a national outcry.

Cox was replaced by Leon Jaworski, a Texas lawyer who led the prosecution force through its successful fight to make public the Nixon tape recordings and to the convictions of Mitchell, Haldeman and Ehrlichman, as well as such other prominent Nixon aides as Charles Colson, Dwight Chapin and Egil Krogh.

Jaworski was succeeded by Henry S. Ruth, who held the office until October, 1975. Since then, the job has been filled on a part-time basis by Ruff, who teaches at the Georgetown University law school.

In the course of its four-year life, the office spent $8 million to pursue investigations and prosecutions that resulted in approximately 50 persons and 18 corporations or business associations being convicted or pleading guilty to assorted felony or misdemeanor charges.

Although the most sensational of these convictions were related to the Watergate burglary, most stemmed from illegal contributions to Nixon's 1972 re-election campaign.