The relationship between whales and the barnacles that grow on them is called commensalism, the barnacle benefits from an interaction while the whale is unaffected
Barnacles attach themselves to whales as free-swimming larva and as the whale grows the barnacle clusters also grow until they form colonies which are the white patches you spot on their head, flippers, back and tail. A whale carries approximately 500kg of barnacles.
The barnacle species on whales are usually unique to the type of whale they colonised, the barnacle Coronula diadema is only found on humpbacks. They fed by sticking their feet out and catching plankton that floats by when the whale is feeding.
It is thought that whales may try to get rid of the barnacles by rubbing themselves up against objects or even breaching, no one really knows.