The boxing career of world welterweight champion Sugar Ray Leonard, 25, was in doubt after he underwent surgery today to repair the partially detached retina in his left eye. He definitely will not fight again for at least four to six months, and doctors said it is too early to tell whether he will ever be able to return to the ring.

But doctors said they were "cautiously optimistic" for a full recovery for Leonard, who had been scheduled to defend his title against Roger Stafford Friday in Buffalo.

The two-hour operation was performed this morning at Johns Hopkins University Hospital's world-renowned Wilmer Eye Institute by Dr. Ronald G. Michels, an associate professor of ophthalmology. Leonard was said to be in good condition and the operation was considered a success. He will probably be in the hospital for about a week.

Michels said the success rate for such surgery is 90 percent. This refers only to the correction of the anatomical problem and not necessarily to the correction of impaired vision. Sometimes there is a partial loss of vision.

The retina is the membrane that covers the back of the eye and receives light, transmitting images to the brain. "It is often compared to the film in a camera," Michels said.

When detached, it becomes separated from the wall of the eye. If the problem is left untreated, permanent visual damage and blindness can result.

For about the last two weeks while training in Buffalo, Leonard had been complaining of blurs and spots in his left eye's field of vision, his trainer, Janks Morton, said.

After consulting two ophthalmologists in Buffalo who diagnosed probable retina damage, Morton arranged for Leonard to be admitted to the Wilmer Institute Saturday; the operation began at 10 a.m. today. Sometimes there is a partial loss of vision.

"Like most professional athletes, Mr. Leonard has excellent vision," Michels said. "We are hopeful he will be able to regain and maintain full vision in his left eye."

In Leonard's case, slightly less than half of the retina was separated. Michels said the retina was reconnected to the wall of the eye and that doctors hope the two will cleave together much in the same manner that broken bones mend.

"Over the next several days we should have some idea as to what will happen. We have reattached the retina and now we need to see how the healing process goes," Michels said.

Michels, one of the nation's leading ophthalmologists, sidestepped questions on whether he would advise Leonard to resume boxing. He said it is possible that punches Leonard has taken in his career could have caused the retina to become detached.

There was speculation that the detachment could have occurred during Leonard's title fight last September with Thomas Hearns. During that fight, which Leonard won on a 14th-round technical knockout, Leonard's left eye was severely bruised and became badly swollen.

"There is no way to be sure when the retinal injury that resulted in the ultimate detachment occurred," Michels said. But he added there is a possibility it could have occurred in the Hearns fight. Leonard has had 33 professional fights; he has lost only to Roberto Duran, in June 1980 at Montreal.

Leonard's lawyer, Mike Trainer, said Leonard will not begin to address the question of whether he will fight again until he is fully recovered.

"He wants to get his vision back. The last thing on anyone's mind now who is connected with Ray Leonard is whether he will ever throw another punch," Trainer said. "That decision will be made after the eye is healed and Dr. Michels says it's 100 percent. Dr. Michels will determine when that discussion is appropriate, and Ray Leonard will determine when that discussion will take place."

However, Trainer did note that two other fighters, heavyweight Earnie Shavers and England's Maurice Hope, returned to the ring after operations to repair detached retinas. Michels was the physician who performed the operation on Shavers.

Dr. Ferdie Pacheco, NBC's boxing consultant and a sports medicine specialist, said Leonard would run a serious risk of reinjuring the retina should he resume boxing.

"I don't know any boxer who should come back after that," Pacheco said. "I think it is his decision. It is his eye. But I would advise him not to go back."

Teddy Brenner, the chief matchmaker for Top Rank, one of the nation's leading fight promoters, said he also would advise Leonard or any other fighter who has suffered a detached retina not to resume boxing.

Truman Tuttle, the head trainer at Hillcrest Heights Boys Club, said he has known several fighters who have retired after similar operations.

"Why lose your sight when you have everything?" Tuttle said. Tuttle also noted that Shavers and Hope have had problems persuading boxing commissions to license them to fight again.

Of the postponement of the fight with Stafford, Trainer said, "The last thing on Ray Leonard's mind is whether he's going to punch somebody again."

Trainer said he will return to Buffalo Monday to make arrangements for refunding money for tickets already purchased.

He said Leonard had no other fight plans set. "We had some negotiations with the (world middleweight champion Marvin) Hagler people, but they fell through."

According to Michels, the procedure was not an emergency operation, but it had to be done soon. Since Leonard was unable to fight Stafford in any case, the decision was made to proceed immediately. In the case of a detached retina, rapid deterioration and permanent visual damage can occur in a matter of weeks or even days, Michels said.

Tuesday was the last day Leonard sparred in training for the Stafford fight. Since then he had limited his workouts to skipping rope and other exercises.

Manager Angelo Dundee said Leonard was in top shape before the injury was diagnosed. "The last time I saw the kid box, he was perfect. He was threading the needle," Dundee said. "What's got to be has got to be, but thank God he's all right."

A gold medalist in the 1976 Montreal Olympics, Leonard grew up and learned to box in Palmer Park. He has won 23 of his fights by knockout.