The timing of surgery in children depends on the condition being treated. For example, congenital heart defects often require early intervention, while other conditions like some hernias may be monitored before deciding on surgery. It is crucial to have a thorough evaluation by a pediatric surgeon and a multidisciplinary team to determine the optimal timing.