It depends upon the type of surgery performed. Generally, it is advised not to engage in any sexual activity for at least 6 weeks to avoid complications with wound healing and to prevent the chances of contracting sexually transmitted infections (STIs).