This is something that varies between patients, because depending on the size of the hydrocele, the existence or not of complications, the speed of healing, etc. the postoperative will be more or less long.
In any case, it does not usually last longer than 2-3 weeks.
Suggested for you: What Is a Hydrocele? – Symptoms, Causes & Treatment.