There are 4 issues that you need to consider:
1 - short circuit handling (e.g. you accidentally drive a nail through the cable)
If a short circuit develops, will the breaker trip before the wire starts to melt. Smaller wires will generate more heat under SC conditions, and will heat up more quickly. Higher rated breakers will trip more slowly.
2 - Overload handling
If a fault develops with the pump causing it to draw 40A (definitely a possiblity if the motor jams), a 20A breaker may not trip for 30 minutes (depends on the breaker, but many breakers will handle 2x rating for 30 mins before tripping). Will the heat generated in the wire cause the wire to overheat? What happens if a short circuit occurs while the wire is already warmed up from an overload fault? (I had exactly this happen to a faulty freezer - the motor was stalled, so it produced a big overload, before a short circuit finally finished it off)
3. Heat removal
If a wire runs through a conduit, then the conduit can trap air around the wire and act as a thermal insulator. This will increase the temperature rise. If you have more than one wire in the conduit, this also needs to be taken into account.
4. Voltage drop
You need to ensure that the pump will receive an adequate voltage to ensure correct operation. If the wire is too thin, or too long, then the voltage will be inadequate. It's not uncommon to have to specify a higher wire size, if the cable length is longer than about 100 feet.
I'm not familiar with US code, but I do know UK code:
It would *not* be acceptable to connect 14 AWG to a 20A breaker. The smallest size acceptable for a 20A breaker in the UK is 2.5 mm^2 which is pretty much 13 AWG.
Voltage drop has to be maintained below 5% in a circuit. Assuming the pump takes 15A - this would mean you need 10 AWG if the length of the cable exceeds 150 feet.
There are other problems with long cable runs - namely ground loop impedance. A short circuit live-ground fault has to produce a big enough current to trip the breaker instantly. If the cable is very long, the SC current might not cause instantaneous trip. In which case you need to install a residual current circuit breaker or GFI on the circuit in question.