How far in advance can I buy a ticket online?

How far in advance can I buy a ticket online?