As a general rule, wire size is determined by the sise of the fuse or circuit breaker. A 20 amp breaker should not be used to feed a wire smaller than #12.

If the run is of any lenght, or the actual load begins to approach 20 amps, then use of a larger wire is called for.

The reasoning is that the breaker determines how much fault current is available- and you'ld want the wire to be able to survive the fault until the breaker can trip.

Now, the code does have some exceptions. The code also pretty much stops at the receptacle (or, in this case, the end of the cord). So it is common for appliances, and light fixtures, to have cords much smaller than the 'house' wiring.

Electrical considerations aside, I have found it impractical to use cords of less than 14 gauge- and then, only for short distances. The lighter cords just do not have the durability that they need to survive for any length of time.
I just wasted an hour on a service call to a commercial kitchen I had wired. The cook was certain that there was something wrong with two of my receptacles, as his mixer would work in one receptacle, but not those two. This was demonstrated to me, by his moving an extension cord from place to place. As you might guess, his beat-up featherweight cord was the problem; every receptacle ran the mixer when my cord was used.
This is just to illustate the concealed damage a cord may suffer fron repeated flexing, crushing, etc.