In some contexts there is no real difference. Both are formed from the word "даль". They are often interchangeable, and we can find idiomatic phrases with both words as attributes: "дальний путь", "далёкий путь" (see here for relative use statistics).
Stable antonyms to those are, respectively, "ближний" и "близкий", which are also rather very similar, although there are some phrases that would use the second word but not the first (you'd say "близкий человек", but "ближнее зарубежье" -- former Soviet republics after USSR had broken up).
Yet, as Roman points out, and where your teacher is correct, when you need to use comparative sense, "дальний" would be better (meaning "farther"), same with the antonyms: "ближний" also has a meaning of "closer", "nearer".
The meaning really depends on the context, and so does their use. For instance, with the noun "дорога
", the phrase "дальняя дорога
" means "road to far away places
", i.e. "road that [starts here and] leads far away
", whereas "далёкая дорога
" has more of the meaning "the road far away
", "the road such that to reach it you need to travel far