UK media reported that the 42-year-old Princess of Wales was "doing well" after the operation, details of which have not been disclosed.
Royal officials announced on Wednesday that Kate had had surgery and was expected to remain in the private London Clinic for 10 to 14 days.
She is not expected to resume public duties until April.
A serious-looking William was seen leaving the private London Clinic about 12.30pm on Thursday.
William drove himself away from the hospital in an Audi e-Tron GT Carbon Vorsprung, followed by a Land Rover Discovery, and left by the back entrance during the low-key private visit.
"The Prince has just left hospital after visiting his wife," Kensington Palace said.
The princess was admitted on Tuesday for the successful, planned procedure.
The princess' office at Kensington Palace did not offer further details but said her condition was not cancerous.
Although she has generally experienced good health, Kate was hospitalised while pregnant because of severe morning sickness.
Soon after the announcement of Kate's hospitalisation, Buckingham Palace said that King Charles III will undergo a "corrective procedure" for an enlarged prostate next week.
The palace said the king's condition is benign.
Details of royal health are always a tricky issue in the United Kingdom -members of the royal family are private individuals but also, in a sense, public property.
Charles is head of state and Kate is destined to be queen when William succeeds his father to the throne.
The publicity around the king's surgery is seen as an opportunity to encourage other men to have their prostates checked in line with public health advice.
The 75-year-old monarch sought treatment "in common with thousands of men each year," the palace said.
An enlarged prostate is common in men over age 50.
The condition affects how one urinates and is noy usually a serious health threat.
It is not cancer and does not lead to an increased risk of developing prostate cancer.
with PA