I would register as far in advance as you can afford (availability of loans, etc.). Depending on where you live, test dates fill up quickly. This is probably most important for CS, with only 6 sites in the country. Also, time from application to ability to register for a specific date is a few weeks (this may be changing soon with fully computerized registrations).
Point is, don't wait to sign up for these. If you know your schedule, and have chosen an ideal date, sign up as early as you possibly can.