Follow your doctor’s instructions. Typically, the advice is to test your semen 8–12 weeks after your vasectomy.
You should aim to ejaculate frequently, starting one week following your procedure and stopping 2–5 days prior to your semen analysis. This will help you “clear out” the sperm from your testes. (Remember, your vasectomy isn’t considered effective until you’ve had a post-vasectomy semen analysis, so these ejaculations should be masturbation or sex with contraception.)