Beverly Sills, the most prominent opera prima donna in the United States, announced yesterday that she will retire from the stage in 1980 and become co-director of the New York City Opera Company. She will share that post with Julius Rudel, the company's longtime director, who has been the principal mentor in Sills' rise to international stardom.

Sills said yesterday, "I'll be 51 in 1960. I have no more operas left that I want to sing. I have sung every role that I ever wanted to in every opera house that I have wanted to. Just to go on for the point of going on would break my heart.

"I did what I set out do and now I am looking forward to a new career with great exhilaration."

She said that she expects to give up singing in all forms after making her final appearance on the stage of the New York City Opera. "One should always say goodbye from the setting of one's own family." And for Sills, the New York City Opera, first in its former home on 55th Street, and then in its glamorous Lincoln Center setting, has always been home.

From the moment of her greatest success there, as Cleopatra in Handel's "Julius Caesar" in 1966, Sills' career became starborn. Since then she has recorded over a dozen complete operas, her fees have risen to the highest paid to any opera singer today, and her engagement book has been filled as much as three years in advance.

As co-director of one of the world's most enterprising opera companies, a company that has always paid special attention to younger American singers and new operas. Sills will be in a unique position to further the case for this country's singers and composers, a role she obviously is relishing already.

In addition, Sills has just been named chairman of Washington-based national Opera Institute, a position in which she replaces Rudel who has held the post since its founding in 1970.

Operatic fame did not come easily or instantly to the woman whose recent autobiography recalls her early years as a child star named Bubbles Silverman.

After years of study with Estelle Liebling, a famous voice teacher in New York City, Sills made the dreary rounds of auditions and sang bit parts from one end of the country to the other, with seasons in which she landed leading roles with touring companies. At one point, Sills recalls in her book, she regularly ate hot dogs warmed on a radiator in a room she rented in San Francisco. That would have been in 1953 when she sang one of the Valkyries in Wagner's "Die Walkuere," and one of the servants in "Elektra" by Strauss.

It was when her singing finally attracted Rudel's attention at the New York City Opera that Sills landed on the main road that eventually took her to Milan's La Scala, London's Covent Garden, and finally, in 1975, to the Metropolitan Opera. By that time everyone admitted that the Met had been criminally neglectful in not engaging Sills sooner.

Her debut at the Met was in Rossini's "The Siege of Corinth." Next week she will star in a Met revival of Massenet's "Thais," a role she studied with the famous Mary Garden. In the fall of 1980, Sills will take part in an extraordinary production of "The Merry Widow" in San Diego when she will share the two soprano roles with her friend and colleague Joan Sutherland. Each one will sing Rosalinde and Adele, alternating in the two parts, but appearing together in every performance.