You will need to know how to swim before about the 6th week of boot camp. If you don't know how, let them know. They will teach you how to swim. You will need to be able to do the following. You will jump off a 10 foot tower into the pool, you will then be required to swim to the opposite side of the pool (about 50 meters). After this, you will need to tread water, face down, for 5 minutes. This is to see if you could survive in the ocean if you needed to. You will also need to show that you can use your clothing as life support in the water.
If you fail to complete all of these, you will not be allowed in the Navy. These are the BASIC requirements for the swimming quals.