I usually use Ivermectin around 6 weeks. It is labeled as being safe then. One year I waited longer than that to deworm and I ended up having colicing colts from the worms, so don't wait but do it as soon as the dewormer says you can.
I start worming monthly and continue until a foal is approx 12 months old. Beginning with Panacur or Safeguard and then add Ivermectin and Strongid by the time the foal is 6 months old. Foals are more susceptible to worms than adult horses and worming monthly is the best way to combat them!
Just a word of caution here...anything that is ivermectin like does a hard fast kill on worms. Pancure or Safeguard gradually kill worms. I recently wormed a 10 week old foal with Ivermectin and had him colic because the fast kill caused a ball of worms to block his stomach. Please be careful in this area.