Selling mutual fund shares is just like selling any other asset that you own; the sale can result in either a gain or a loss.
There's a gain if the amount that you get from the sale exceeds your adjusted cost for the shares (what the IRS calls your "basis"). If you sell the shares for less than your basis, you have a loss.
How long you owned the shares before selling makes a difference, too. If you owned the shares for one year or less, the gain or loss is treated as a short-term capital gain or loss. If you owned them for more than a year, you have a long-term gain or long-term loss. That distinction can make a big difference in the tax consequences of the sale. Short-term gains are taxed in your top tax bracket, as high as 35%. Long-term gains are taxed at 15%, or just 5% if you are in the 10% or 15% bracket.
For additional information on the sale of your mutual fund shares, see IRS Publication 564.