You can buy theater tickets anytime you want as long as the tickets are available. When is a good time to buy these tickets? If you know that the tickets are available, it is always best to buy them right away. This ensures that you are going to get a good seat. If you are someone that needs the best seat in the house, then yes, buy theater tickets right away. If it is going to be a popular musical, you can be sure tickets will sell quick.
If it is an event that might not be that popular, you might be able to wait and buy your theater tickets at the door. This idea is great for people that do not care where they sit. Most people like this usually want the cheapest tickets possible. If you wait and buy them at the door you will not have to pay any extra fees either.
Otherwise you can buy your tickets at any time. Pay attention online to how many tickets are available yet and where the seats are. Then you will have a good idea of how popular the event will be. If you can buy the tickets at the event center in person, they can usually find you better seats too.