This article is from the Beginning Fishkeeping FAQ, by Thomas Narten with numerous contributions by others.
(adapted from the SALTWATER BEGINNER FAQ)
Once you get the fish home you should set the bag in your tank,
allowing the temperature to equalize. After about a half an hour or
so, add a 1/4 cup of tank water to the bag. Repeat this process once
every 15 minutes for an hour, removing any water if the bag gets too
full. Any water you remove from the bag should be disposed of. It will
most likely contain parasites and other bad things.
After you have the fish acclimated to your tank's water chemistry,
there are a couple of things you can do. You can place the fish
directly into the main tank and hope for the best, or you could place
the fish into a quarantine tank. In either case, quickly net the fish
from the bag to the tank so that no store water gets transferred to
the tank.
The best scenario is to place the fish in quarantine. Keep the fish in
the quarantine tank for 2 weeks and watch for signs of disease. If the
fish gets sick, you can medicate the quarantine tank without affecting
the chemistry of the main tank's. If you are going to quarantine the
fish, you should acclimate the fish to the quarantine tank's
chemistry, not the main tank.
While a quarantine tank is a good idea, it is most likely that you do
not have such a luxury (for now, at least... :). In this case, be
extra careful to select healthy fish at the store, and carefully
monitor your new arrivals for the first few weeks in your tank for
signs of stress and disease. You always risk infecting the other fish
in your tank when skipping quarantine.
 
Continue to: