How soon after having a hydrocele removed can I start having sex again?

Soon. One can start having intercourse soon after a hydrocele if there is no swelling or pain. This can typically be done in around 10 days. Factors to take into account include the size of the hydrocele and comorbid conditions such as diabetes because these can prolong the wound healing phase after surgery.
Until... There has been no magic timing to restrict sex after hydrocelectomy, but let common sense rule what we can do and need. So, as long as you can cope with postoperative pain and swelling, you can have sex whenever you like, but common sense guides most reasonable men not to have sex for at least 1-2 weeks after surgery there.