It depends on the child, the parents' expectations, and the experience you want for your child.
Take babies in the pool as soon as you are comfortable doing so, after the umbilical cord has fallen off and the navel is healed. Walk with your child in the water, hold him tight, pull him through the water (head out), talk to him in a soothing voice and make him feel comfortable and secure.
If you are uncomfortable taking your baby in the water, pay an instructor for a private lesson, but only if you have disposable income and it is something that is important to you.
Mom and Baby/Tot classes are GREAT! Mostly this is a social experience, but parents learn how to hold their child in the water, skills they can work on with their child, and the child is introduced to the water with the security of the parent being with him (this is important, especially in the case of separation anxiety).
Some children are ready for private or group swim lessons without the parent around age 2 years-old.
Most children are capable of learning how to swim and how to breathe around 3-4 years-old. This is my preferred age for children to begin swim lessons. Children at this age more easily get over their fears of swimming (if they have any), they typically have less separation anxiety, and they are physically capable of swimming. It is important at this age though, to continue lessons, even if the child is scared. See- What to Do if My Child is Afraid of aswim Lessons. Make sure you have a gentle, experienced swim instructor to help get your child swimming without instilling fear in your child by pushing him too hard, too fast.
If your child is older than that and you have not yet started lessons, don't worry- it's never too late, but the sooner the better!!! It is WAY easier to teach younger children to swim than older children, especially if there is a fear factor.
This is my opinion based on 27 years of teaching swim lessons. There are certainly other philosophies out there, but I believe in introducing children to the water in a way that will allow them to love the water forever, without causing any necessary fear. There is no such thing as "drown-proofing" a child, no matter how skilled he is. The American Academy of Pediatrics now recommends swim lessons for children between the ages of 1-4 years old. Children who have taken formal swim lessons "may be less likely to drown." https://www.aap.org/en-us/about-the-aap/aap-press-room/pages/AAP-Gives-Updated-Advice-on-Drowning-Prevention.aspx?nfstatus=401&nftoken=00000000-0000-0000-0000-000000000000&nfstatusdescription=ERROR:+No+local+token
Coach Mandi has been teaching and coaching swimmers at the USA, summer league, high school, and Masters