The dependent variable is what changes because of the independent variable, while the independent variable is what is purposefully changed by the experimenter, since it is the variable that is being tested.
So, in this problem, you are purposefully changing the distance of the race to see whether or not the amount of time taken to complete the race will change because of the varying distances.
This means that purposefully changing the distance of the race is the independent variable that is being tested and that the amount of time that the runner takes to complete the race is the dependent variable because it changes due to the independent variable.
Sorry for being so wordy.
In short,
Independent variable- the one that's being tested and that is purposefully changed.
Dependent variable- the one that changes because of the independent variable.
Hope this helps.