Babies can do this for several different reasons. Sometimes it's when the milk flow slows down or the breast is drained. Switching to the other side at this point can often help. You can switch back and forth several times if you need to. Since the breast is continually producing milk, your baby may be able to drink again on that side.
Sometimes babies pull away from the breast and fuss because the milk is flowing too fast. If this is the case, you may find that your baby pulls away soon after starting to feed and just as the milk is letting down. She probably starts swallowing faster and faster, and then pulls away and fusses because she can't catch her breath. If your baby does this, give her a minute to catch her breath and calm down before putting her back on the breast. This may help her relax.
I've also found that some babies get tummy pain from eating too quickly, and they may start to fuss and pull away as they're eating. If your baby is a fast eater, try tucking one of her knees up to her tummy while she’s nursing. This seems to help babies feel a little bit more comfortable, as opposed to when they’re feeding "stretched out."