How long after breastfeeding should I do formula?

My babies doctor wants me to supplement due to her not gaining weight as she should be. He said I didn’t have to immediately after but didn’t really give me a time.