Word for word means you've committed it to memory exactly. If you recite it, every single word will be exactly correct, the same as the words you read earlier. This phrase is about accuracy.
Word by word means that you memorized it one word at a time. It's more about the method you used while memorizing than the accuracy of the result.
They are not quite the same, but they are similar.
Two-year-old is an adjective. You can say, two-year-old girl, or two-year-old cat, or two-year-old child. Sometimes, two-year-old is used as a noun on its own, and it that case ("My two-year-old", say), child is usually implied, although it could refer to an animal if the context is clear. It's a compound adjective, with dashes to make it clear it is all one phrase, and it is usually pronounced with the words run together. You might see it without the dashes, and it is usually clear what is meant.
You can't say "My daughter is two-year-old". In that case you say "My daughter is two years old".
I think the reason why it's year, when with dashes, is because the words are run together, and years would be hard to say.
Best Answer
You have an interesting example! In your example the meaning of the two are equivalent, but that's not usually the case.
Normally
When we say in 10 years we mean that something will happen in the future (the time that will elapse before the event).
When we say for 10 years we mean that a situation has been happening (or will be happening with a future verb) over a period of 10 years (duration of time)
In your example
Your first option "We haven't spoken in 10 years" is using in to refer to a period of time during which the situation has continued. This is because the verb is in the past and refers to an ongoing situation (not speaking) and then in gives the amount of time that has elapsed since that situation first started. So because the event is the star of an ongoing situation in this case the effective meaning is the same.