They need to get back to the SZ (if on a Carrier) or to a territory. You count each move.
Remember Air units don’t have to go back to from where they came. They can land on any territory you owned at the beginning of your turn or to another Carrier (if there is space).