Timing will depend on whether you're heating breast milk or formula.
If you're heating breast milk, most experts including the CDC and the Academy of Breastfeeding Medicine (ABM) recommend that you use the breast milk within 2 hours of warming.
For formula feeding, guidelines are similar but not as specific. The CDC recommends that prepared infant formula be used within 2 hours of preparation and within 1 hour from when you begin feeding your baby.
They discourage reusing any leftover formula in your baby's bottle from a previous feeding. The CDC doesn't clarify if there's a difference in formula that's at room temperature as opposed to heated, so it's a good idea to either use it shortly after, or dispose of warmed formula that's been out for an extended period.