Восьмилетнему is the Dative case, masculine, singular of the adjective "восьмилетний" which means "who is 8 years old". The adjective has two parts: "восьми", which is the numeral "восемь" in the Genitive case (because the meaning is "of 8 years") and "летний", which comes from the noun "год-лет".
Он подарил телефон своему восьмилетнему сыну.
He gave a phone to his 8-year old son.
Russian Language Teacher.