Ten years old comes after a verb (be/become). "She will become ten years old tomorrow. he is ten years old."
Ten year old comes after an article(a,an,the) or adjective(kind,little,etc.). "I am a ten year old boy. That cute, little ten year old gave me some flowers."