I would say at least 3 weeks before your head count is due. Some people are very bad about deadlines and if you give them three weeks before your head count, you'll be getting responses back the week your count is due.
Check with your caterer, or whoever might be doing the set up for the venue. Usually they will want you to be able to give them a firm head count for your event at least a week before the ceremomy/reception. Most brides choose an RSVP date that's 2 - 3 weeks before the ceremony and/or reception.