A wire has to pass two checks. It must carry the current without overheating, which is the NEC ampacity for its insulation and cable type. And on long runs it must not lose too much voltage, which depends on its resistance and the length of the circuit. This calculator works out the smallest size for each and recommends the larger of the two.
Enter the load in amps, or in watts and the calculator divides by the voltage (and by √3 for three phase, assuming a power factor of 1). Length is one way, from the panel to the load; the calculator counts the return path itself. For continuous loads, those that run for three hours or more such as EV chargers, storage water heaters of 120 gallons or less and many heaters, tick the box: the NEC sizes the circuit for 125% of the load.
The cable type sets the temperature column. Choose 60 °C for NM-B house cable, UF cable, or any circuit whose breaker or device terminals are not marked 75 °C. Choose 75 °C for wires such as THHN or XHHW in conduit when everything they connect to is rated 75 °C. For copper 14, 12 and 10 AWG the calculator also applies NEC 240.4(D): 15, 20 and 30 A at most.
Voltage drop uses the resistance of the wire at 75 °C. The NEC's informational notes suggest no more than 3% on a branch circuit and 5% in total; this is a recommendation rather than a rule, and you can set your own limit. Lights dimming when something starts, or a motor struggling, are common signs of too much drop.
The table under the result shows the recommended size with the next size down and up, so you can see how much margin each gives.