Fish slime is very important for the survival of fish. The slime is secreted from cells in the outside-most layer of the skin. The cells produce what is called a glyco-protein, which is then mixed with the water making the slimy mucus. The slime is important for fish to regulate many necessary body functions, including protection against parasites. The slime will also act as a band-aid, covering wounds and scrapes. Some studies indicate that the slime may aid in reducing the turbulence along the body, making the fish faster in the water.
For more information, please read the story Why are Fish so Slimy