It's not really about how long you have to eat sugar after you treat your yeast infection, but moreso is your yeast infection treated? Depending on what your condition is like it will take longer periods of time to treat a yeast infection, but if you have successfully treated your yeast infection you can consume sugar. Your sugar consumption still has to be in moderate amounts, and you really should not go to a diet high in refined sugars, but instead you should try to eat a healthy diet. Technically Candida or yeast is in all of our bodies. It's required for digestion, but the real problems occur when your immune system becomes weak and there is overgrowth, so what you must do is keep your immune system healthy.
An example of sugars that should not harm you after you have successfully treated yourself from Candida would be fruits. Apples, pears, peaches, watermelon the list is countless, and fruits themselves taste great as long as you're not accustomed to a processed foods diet.
So I think instead of worrying about whether you can eat sugars after you treat yourself, changing the way you eat, your diet, your wants, your needs will give you far more benefit. Your body will thank you for it, and you will reduce your risk of catching another yeast infection again.