This 1980 New Scientist column article says that
Human babies can swim instinctively at a few weeks old, and although they lose this ability at a few months they learn quickly if introduced to the water and taught how to swim when a couple or three years old.
However, BabyCenter in the US claims that they not natural swimmers.
No. It's not true that babies are born with the ability to swim, though they have reflexes that make it look like they are.
A reflex called the bradycardic response makes babies hold their breath and open their eyes when submerged in water, says Jeffrey Wagener, a pediatric pulmonologist in Colorado. (Parents can cause this same reaction by blowing in their baby's face, a response that disappears after about 6 months.
Meanwhile, the description on this YouTube video warns they only look like they can swim:
Until around 6 months, babies placed in water tummy-side down will move their arms and legs in a swimming motion. When the swimming reflex and the dive reflex are both engaged, a baby can look like a natural swimmer.
Cautions about babies in water
"These reflexes don't mean the baby can swim, though," says Wagener. What's more, they don't protect a baby from drowning. (In addition to the risk of drowning, it's dangerous for an infant to swallow large amounts of pool water.)
BabyCentre in the UK claims somewhere in between:
Your baby does have a natural ability to swim, but she needs your help, of course! Her natural ability comes from a pair of reflexes she has when she's in the water.
This Wikipedia page says:
Human babies demonstrate an innate swimming or diving reflex from birth until the age of approximately six months.
Can babies naturally swim without training?