A 20 amp circuit takes 12 AWG copper. That holds in NM-B cable, where 12 AWG copper is rated 20 A at 60 °C, and it holds with THHN in conduit, where Table 310.16 lists 25 A at 75 °C but the breaker still can't go past 20 A. In aluminum the answer is 10 AWG.
The reason it is 12 gauge and not 14 is NEC 240.4(D), which sets the largest breaker for the smallest wire sizes no matter what the ampacity table says. Table 310.16 lists 14 AWG copper at 20 A in its 75 °C column, so on the table alone it looks like a fit. 240.4(D) caps 14 AWG copper at a 15 A breaker in every column, cable or conduit. The same section caps 12 AWG copper at 20 A and 12 AWG aluminum at 15 A, which is why aluminum on a 20 A breaker starts at 10 AWG, rated 25 A at 60 °C.
In practice that means every length of wire on a 20 A circuit is 12 AWG or larger, including the short jumpers between receptacles and anything added to the circuit later. One stretch of 14 gauge on a 20 A breaker is a stretch the breaker doesn't protect. If you find one, have an electrician decide how to correct it; the answer depends on what the circuit feeds.
Length matters more here than on the larger circuits, because most 20 A circuits run at 120 V. The same current through the same wire loses the same number of volts, and at 120 V those volts are twice the share of the supply they are at 240 V. With the full 20 A on 12 AWG copper, the drop reaches 3% at 46.6 feet one way; at 240 V the same wire would reach 93.2 feet. So the length table below steps up quickly: 10 AWG at 50 feet, 8 AWG at 75 and 100 feet, 6 AWG at 150 feet and 4 AWG at 200 feet, in both copper columns.
Those sizes assume the whole 20 A is drawn at the far end. Voltage drop scales with the current, so half the load means half the drop: 10 A at the end of 100 feet of 12 AWG copper drops 3.22%, against 6.44% at 20 A. A string of receptacles seldom puts the full rating at the last one, but a single heavy load at the end of a long run, such as a shop tool or a heater in a detached garage, should be sized as one. Put your own load and distance into the wire size calculator.
Loads that run for hours count for more. A continuous load is sized at 125%, for the wire under 210.19(A)(1) and for the breaker under 210.20(A), so a 20 A circuit carries at most 16 A of continuous load, 1,920 W at 120 V. Going the other way, larger wire is always allowed on a 20 A breaker: 10 AWG copper is a common choice on a long run, as long as each receptacle and device is marked to accept that wire size.