After 24 hours of mounting pressure, Dr. Peter G. Bourne resigned yesterday as President Carter's chief adviser on health and drug abuse because, he said, he was being used by others to damage the president politically.

In a letter to Carter, Bourne, who is being investigated for writing a prescription made out to a fictitous person, described himself as "an instrument through which others attempt to bring disfavor to you," and said that because of that "I no longer feel that I can be a productive part of your administration."

White House press secretary Jody Powell, who announced the resignation, said Carter accepted it "with regret." He said the decision to resign was Bourne's alone.

Some White House aides were clearly saddened by Bourne's fate, but there was also a sense of relif among them at the unexpectedly sudden resignation, which came just four hours before the president appeared at a nationally televised news conference last night.

He opened his news conference by saying he would not answer questions on the Bourne resignation because various "allegations" are under investigation. He did say that he accepted the resignation "with regret."

Bourne is a "close friend of mine and my family," he said, "an able and dedicated public servant."

Bourne spoke by telephone with Carter yesterday, but declined to disclose details of the conversation.

The resignation of the 38-year-old English-born psychiatrist climaxed two days of intensive discussion within the White House on how to deal with the criminal investigation by Prince William County police officials into the drug prescription case.

The drug that Bourne prescribed is Quaalude, a tightly restricted drug used at a physician's direction to produce sleep or sedation. It is in heavy demand in the illicit narcotics market by young people who believe it to be an aphrodisiac or use it to change moods.

Bourne has said he intended the drug for use by Ellen Metsky, his administrative assistant in the White House, but made out the prescription to a fictitious "Sarah Brown." When a friend of Metsky, Toby M. Long, 26, sought to have the prescription filled in a drugstore in Woodbridge, she was arrested and charged with seeking to obtain a controlled drub "by fraud, deciet or misrepresentation,"

Long is free on bond, but the investigation is continuing, and the Prince William prosecutor has said he is considering bringing charges against Bourne.

When Bourne was placed on a paid leave of absence from his $51,000-a-year White House job Wednesday night he defended his use of the false name as a "legitimate precaution" to preserve Metsky's confidentiality.

Bourne's letter of resignation was highly personal, including a reference to the president as "my friend." In it, he suggested that news reports of the case left him no choice but to resign.

"I believe that you have known me long enough to know that even though I make mistakes, they are of the heart and not of the mind," he said. "However, there is really no way for me to combat the charges publicly made against me and the rumors which run rampantly throughout this community."

Underlying all of these developments," Bourne continued, "are constant and unrelenting attacks upon me by those who seek to hurt you through my disparagement."

After saying that he expects to be indicated, Bourne concluded the letter by writing:

"Finally, my friend, I know that you know that it is ever more difficult for people of good will to enter public service. I have never intended to do anyone harm. I became a psychiatrist to help those who need help most, to alleviate suffering and to help this country meet the needs of the poor here and elsewhere in the world.

"I fear for the future of the nation far more than I do for the future of, your friend, Peter."

In an interview after the resignation, Bourne described his situation as a"a political problem." He said he decided after reading news accounts of the case yesterday morning that it would just drag on and that he had to resign to protect Carter.

"It was very much my decision," he said.

Bourne, accompanied by his lawyer, Charles Morgan Jr., spent much of Wednesday meeting with Powell, Hamilton Jordan, the president's chief political adviser, the White House counsel Robert Lipshutz. He called the meeting "a free discussion," and said the White House aides were "very supportive."

But while Carter's top aides may not have pressured Bourne to resign, they clearly did not seek to prevent it. The Bourne case threatened to dominate the president's news conference last night, and was one more unexpected blow to Carter's presidency.

Moreover, Bourne, who worked for Carter when he was governor of Georgia and was one of the first people to urge him to run for president, was never close to the top presidential assistants. It is unlikely that any of them wanted Bourne to stay.

Even within the White House, there was some skepticism over Bourne's explanation that he used the fictitious name to protect his aide's confidentiality.

There were also inevitable comparisons with Bert Lance, the former director of the Office of Management and Budget who resigned last fall after a protracted defense by the president and his top aides, and expressions of relief that, in the Bourne case, the White House acted quickly.

"Responding on the same day is a hell of an improvement over our previous record," said one official of the initial decision to place Bourne on a leave of absence.

It remained unclear last night when Carter first learned of the case. Powell was informed of it Friday while traveling with the president in West Germany, and Bourne told Lipshutz of it Tuesday. But neither they nor others would say when Carter was told.