The sooner the better, but ideally 12 months or more before the wedding date.  Elopements may not require as much time beforehand.