It's personal preference, really.
Many swim from birth. However, unless they are naturally brooded (mother) they should be in water only under supervision, and dried off thoroughly after. Even with a mom, ducklings should be restricted until they are 2-4 weeks.
Ducklings can swim unrestricted, unsupervised at 6-10 weeks- whenever they get their feathers totally in. This is when they get their oil and become "waterproof".
I let mine play in shallow water that was the same temperature as the brooder from day two onward. At first it was in a cake pan, then we moved to the tub.
And I watched them closely, and made sure anyone who did not start preening got dried off with a washcloth.