Before anything else, you'll want to remove the water leak that caused the stain. If you don't do this, any repair will jsut be damaged again during the next leak.
After removing the leak, you can repair the water-stain by priming the surface with a special alcohol or oil-based stain blocking primer. These primers will prevent the stain from bleeding through to the paint top coat. Without this primer, the stain will continue to bleed through to the surface.
The alcohol-based primers are the best at blocking stains (Zinsser BIN). The downside is that they smell really bad, but it dries really fast and does an awesome job at blocking the stain. The next best product to use is an oil-based stain-blocking primer (Zinsser Coverstain). These stain blocking primers also block other things like smoke-stains, marker and lipstick from bleeding through, too. We do not recommend using a water-based primer to block stains.
You may find it necessary to replace the sheetrock if it has been severely damaged. If the sheetrock is in good condition and just has a stain, then painting should suffice. But if the sheetrock itself is crumbly or weakened, then cutting out and replacing the damaged section may be the best course of action.
After the stain has been primed with a stain-blocking primer, then you are ready to repaint.
Make sure to use a disposable roller cover or paint brush to apply the stain-blocking primer. It is cleaner and easier and better for the environment to throw away a cheap brush then to use solvents to clean them.