The correct option is
A ten-kilometer
Compound adjectives can be formed using a noun + adjective, noun + participle or an adjective + participle. The words in compound adjectives are hyphenated (-).
The noun here is 'race', and the words 'ten kilometers' describe the race. Hence the correct form of these words should be an adjective form.
Option B: 'Ten-kilometer' is a compound adjective made with ten (adjective) + kilometer (noun). It modifies the noun 'race' and is hence the correct option.
Option A: 'Ten kilometer' is not a compound adjective, since it does not have a hyphen '-'. Also, since it's a phrase, 'kilometer' should be plural 'ten kilometers', as the number says it's more than one kilometer. Hence this option is wrong.
Option C: Similarly, 'ten kilometer's' also has a singular noun 'kilometer' in the possessive case (with 's added to it). This is not the right form and hence C is wrong.
Option D: 'Ten-kilometers' is wrong because it's a compound adjective. Adjectives do not have a plural form.