The first prescription pill to help control repeated outbreaks of genital herpes, a sexually transmitted disease afflicting millions of Americans, is expected to be available nationwide in about two weeks, but it will be expensive to take on a long-term basis.

The drug, oral acyclovir, will be marketed as Zovirax Capsules by Burroughs Wellcome Co. of Durham County, N.C., at a cost of $60 or more a month. The drug is taken several times a day to suppress recurrences of genital herpes, but company and government officials are recommending that it not be taken for more than six months at a time.

The cost of treating an acute, repeat outbreak of the painful condition would be about $16 for a five-day course requiring five pills a day, said Dr. Dannie King of Burroughs. Treatment for an initial attack runs about 10 days.

The market for the drug could be large; genital herpes afflicts 5 million to 20 million Americans, with 300,000 new cases reported each year. Experts stress that oral acyclovir does not cure the chronic disease, but can stop or retard growth of the virus.

The genital herpes virus is thought to remain in the body indefinitely and can be reactivated at any time to again cause painful skin sores. While some sufferers seldom have repeat episodes, others are afflicted by a dozen or more recurrences a year.

The Food and Drug Administration, announcing its approval of oral acyclovir as a genital herpes treatment, noted that two National Institutes of Health studies showed that the drug, when taken regularly for up to four months, reduced the number of recurrences and/or their severity in more than 95 percent of cases, and that recurrences did not occur in 40 to 75 percent of the patients.

Burroughs and the FDA initially have agreed that the drug should be discontinued after six months' use because its safety and efficacy are not known beyond that point.

Herpes researchers cautioned that although oral acyclovir appears to have few side effects (stomach upset and headache in some patients), years of follow-up study are needed to determine if unexpected health problems result from its use. It took years for rare but serious side effects to develop among women taking birth-control pills.

Dr. Yvonne Bryson of the University of California at Los Angeles, in one of several news conferences arranged by Burroughs yesterday, said long-term treatment with oral acyclovir is most suitable for people who suffer six or more outbreaks of genital herpes a year, "probably 10 to 20 percent" of those who have the disease.

Dr. Lawrence Corey, a University of Washington researcher who has studied acyclovir, said that the drug should be discontinued after six months of daily use and that subsequent treatment should be considered only if the patient has enough outbreaks to justify it.

Acyclovir has been available since 1982 in a prescription ointment form for initial infections of genital herpes and in an intravenous form for hospitalized patients.

The drug has been shown to reduce significantly both the symptoms of the infection as well as its duration; however, treatment with acyclovir does not guarantee that an afflicted person is not infectious to others, experts caution. Herpes is most contagious when active genital sores are present.

The labeling for acyclovir will warn that it should not be taken during pregnancy unless the potential benefit justifies the potential risk to the fetus.

Although the drug is being approved only for treatment of genital herpes, studies are under way to test its value in treating other herpes virus diseases, including the oral herpes that commonly causes cold sores, chicken pox and shingles.