I have gout. How long do I have to wait from last flare to start alopurinol?

Not long. Some doctors wait 2-4 weeks but if you take Colchicine to prevent gout recurrences, your doctor may only wait a week to start allopurinol.
Don't need to wait. As long as you take something such as cochicine to prevent gout attacks along with it, you can start Allopurinol right away. Note that there are different kinds of gout: overproducers and underexcreters. They may be treated differently, a good doctor can help determine which kind you have based on a 24-hour urine test.