He can't swim... very well.
But he suddenly realised what he was saying, and he felt the
excitement drain out of him as though someone had just pulled a plug
in his stomach. He wasn’t a very good swimmer; he’d never had much
practice. Dudley had had lessons in their youth, but Aunt Petunia and
Uncle Vernon, no doubt hoping that Harry would drown one day, hadn’t
bothered to give him any. A couple of lengths of this bath was all
very well, but that lake was very large, and very deep … and merpeople
would surely live right at the bottom …
Harry Potter and the Goblet of Fire
Having gone to a British primary school, it's likely he would have had a few lessons as part of his normal class activities, but only enough to prevent casual drowning.
In later books he seems to have no trouble swimming in open water.
And with the sudden agility of a much younger man, Dumbledore slid
from the boulder, landed in the sea and began to swim, with a perfect
breaststroke, towards the dark slit in the rock face, his lit wand
held in his teeth. Harry pulled off his Cloak, stuffed it into his
pocket and followed.
The water was icy; Harry’s waterlogged clothes billowed around him and
weighed him down. Taking deep breaths that filled his nostrils with
the tang of salt and seaweed, he struck out for the shimmering,
shrinking light now moving deeper into the cliff.
Harry Potter and the Half-Blood Prince