The P Gain (which stands for Proportional Gain) parameter basically controls how your quadcopter prioritizes pilot input versus input from the flight controller's onboard sensors.
A high value of the P Gain parameter means that the readings from the sensors will be very important. A low value of the P Gain means that pilot input will be very important.
If the P Gain is set too high, you might notice the quadcopter oscillating or kind of twitching in the air. This effect is caused by the flight controller's frantic attempts to correct even the tiniest sensor discrepancies. If the P Gain is set too low, the craft will seem sluggish and slow to react to changes in orientation on control input. It will probably be difficult to keep the quadcopter airborne if the P Gain is too low since the quadcopter will be expecting you, the pilot, to do most of the work needed to keep and craft stable, and unfortunately, our brains and our thumbs are just not quick enough to make the rapid adjustments needed to keep the craft in the air.
The I Gain (which stands for Integral Gain) controls how quickly the quadcopter will respond to changes in angular orientation.
In other words, let's say you are flying your quadcopter and you want it to move forward. To do this, we tilt the quadcopter forward. This forward tilt directs some of the quadcopter's lift backwards instead of all the lift being directed downwards, which makes the quadcopter move forward. When we release the stick, the quadcopter will return to a level position.
Neither the tilting forward nor the returning to a level position happen instantly though. It obviously takes a little time for the quadcopter to actually move. The I Gain basically controls how aggressively the quadcopter attempts to achieve the designated tilt.
If the I Gain value is too low, the quadcopter will see sluggish and slow to respond to control input. If the I Gain is too high, the quadcopter will again oscillate in the air as it fights to keep a perfect position.
Tuning P Gain
Starting with the values suggested in step 19 of this Instructable, if you feel like your quadcopter is a bit too sluggish, turn up the P Gain in intervals of five until you get the responsiveness you want. If you notice your quadcopter oscillating in the air, back the P Gain off a bit.
Tuning I Gain
Starting with the values suggested in step 19 of this Instructable, if you notice your quadcopter does not stop and stabilize after moving the sticks and returning them to center, increase the I Gain increments of five until you get a quicker response time. You want to get to a point where the quadcopter returns to a level position quickly and does not wander around in the air.
The I Gain value is also useful if you are flying in windy conditions where it is more important for the quadcopter to correct its angular position and not get moved around by the wind as much.