You'll obtain Surf from Cheren in Route 6 after beating the 5th Gym Leader and driving away Team Plasma from the PWT. This HM allows you to enter and move around in deep water.
However, you were forced to skip over some areas in the game that you couldn't access without Surf. So once you have Surf, you may wish to head back to these locations and access the areas that required it. There are a few, so it may take a little bit of work to go through each area.
Note : Besides the areas we've listed, there are other bodies of water that you can Surf on, but they don't lead anywhere. You can however Surf to find Pokemon there.