Try to understand what your bird is trying to tell you, before biting.  Provided is an article by Sally Blanchard

Understand Parrot Bites- Sally Blanchard

Sometimes birds bite, but don't take it personally. Instead, try to see what your parrot was telling you before she bit you.

A bird's beak is like their lips, mouths and hands all rolled into one.  Parrots use their beaks when playing too, such as when they tear apart new toys.

Wild parrots are not offensively aggressive. They tend to be defensively aggressive; they bite to protect, defend or discourage. A parrot will bite if its territory or mate is threatened; it will bite if it perceives that it is being threatened by a predator.

Companion parrots bite for the same basic reasons as wild parrots, but they also sometimes bite if they are confused and want to get out of a threatening or uncomfortable situation. When people ignore their parrot’s more subtle clues, biting becomes a communication with an exclamation point.

The truth is that parrot beaks are not used as weapons any more our hands are. The beak has many functions, and it serves the same purposes of our lips, mouths and hands. It is used to manipulate and process food to prepare it for digestion. Parrots use their beaks to slice, dice, shred, rip, tear and demolish almost anything faster than any other animal can without extra tools. Beaks are used to play-wrestle for fun or even to show affection in courtship. Parrot mates use their beaks to preen and caress each other.

Too many novice caregivers have the misconception that their parrots intend to bite when they reach out with their beaks. Beaks are used to explore, and a parrot often reaches out with its beak for balance. Often when a parrot touches a person’s hand with its beak, it is to test the stability of the perch. Some companion parrots, whose human friends don’t set rules for them or don’t properly read their body language, learn that their beaks are powerful tools for getting their way!

Sometimes a young bird will nibble on your fingers.  This isn't an aggressive behavior, just a young bird being curios.

Think Before You React To A Bite
Obviously if a companion parrot uses its beak aggressively, it can do some serious physical damage. When people take a bite personally and blame the bird, and/or change their attitude toward their parrots, it can damage the relationship to the point where mutual trust is lost.

When one of my parrots bites me, I always stop to think what I did. The truth is that, the vast majority of the time, I did something that threatened or confused the bird. Once the biting incident is over, I need to lower my energy and approach my parrot in a less-direct or less-threatening manner. The bird responds to my calm manner, and all is forgiven between the two of us.

This is one of the major differences between wild parrots and companion parrots; wild parrots probably never accept apologies from the other animals they have had to be aggressive toward. 

Understand The Bite
1) Wild parrots usually only bite when they are defending themselves, their mates or their territories.

2) In our homes, parrots might bite if they are confused or feel threatened.

3) Often times, biting becomes the only way a parrot can communicate with you.

4) Don’t take a bite personally. Try to see where your parrot is coming from, and why she bit you.

Understanding Parrot Bites - BirdChannel