I think a lot of it depends. If it's a food allergy like cow's milk that's making him feel unwell with food and not eating because of that, then it should turn around relatively quickly - a week or so for the proteins to entirely get out of your system and his, a week for him to really pick up his eating, and maybe the third week you might start noticing gain.
If it's something like celiac disease (which is not an allergy), it would take longer, as he would need to heal any damage that had occurred first, and then could begin absorbing more food again. (And it wouldn't happen as quickly if you aren't SUPER careful about the offending foods getting into your food.)
I hope the food allergy board has more help!
Good luck!