The first step is to wash the gelcoat with a good quality soap, and a sponge to remove any softer stains from the surface. If the stain is still there, the next step would be to use a stain-lifting material, such as Davis FSR, TotalBoat White Knight, or Y-10 fiberglass stain remover. These products combine the power of a light acid in a gel form to help most other stains. There are stronger products like MaryKate's On-Off Hull & Bottom Cleaner that are also commonly used. In many cases, it's not necessary to use products that are this strong. It should be noted that extra care has to be taken when near certain metals, and to avoid allowing the product to come in contact with the metals.
The next step would be to compound or polish the gelcoat, bringing out a high-gloss finish that can help resist staining. 3M Perfect-It and Finesse-It products, Aqua-Buff, TotalBoat compounds, and Meguiar's compounds all have different stages, from heavy to fine cutting compounds. The compounds will also help remove stains that the chemicals and soap can not reach.
The final step is to help prevent further staining by adding a high-quality wax to the surface, leaving a smooth, shiny surface that stains will have a harder time grabbing onto.