How long it will take for recovery from hydrocele surgery?

Longer in adults. 1 - 2 weeks for an adult. Depends upon how large the hydrocele pre-operatively and whether pressure dressing &/or athletic supporter was used & physical activity post-operatively. Children recover recover much quicker & in a few days; less time the younger they are.
Not long. It is a fairly minor surgery and recovery is not too long. There will be mild discomfort and swelling expected. Most activities would be ok, but check with your surgeon first.