It can be both, they have slightly different nuances.
"Il caffè è tuo" maybe it was mine, or maybe you have so much coffee and this is one of your many coffees...
"Il caffè è il tuo" that's the only coffee that is yours, and probably I am not stating it in the most gently way ever.
Think about it like this: Il caffè è tuo = the coffee is yours Il caffè è il tuo = the coffee is yours, but it is THE ONLY coffee that's yours, and it's not as polite.
In English, the equivalent would be something like: "the coffee is yours", versus; "that is your coffee".
In the first case, we're not sure how many coffees the person has. In the second, we're still not 100% sure, but we can more accurately assume that it's their only one. Also, it doesn't sound as nice.
I hope this helps.
If the correct answer is based on a nuance, then they should teach that. Just throwing these types of nuanced sentences into the lessons without some explanation is not good instruction. Few will be able to distinguish the difference without some more definite guidance. These unexplained exercises confuse the students and create a lack of confidence. You can often google grammar to gain a deeper understanding of something you are struggling with but I can’t find anything about these type of differences
The "tuo", (yours), is at the end of the sentence not the beginning which changes it to yours from your. If you wanted to say "It is your coffee" you would need to put the "tuo" at the front of the sentence and the subject, (caffe), at the end just as you would using the words "yours" and "your" in English.
Because the grammar structure is very different.
The coffee is yours = Il caffè è tuo:
- "the coffee" is the noun phrase in the subject, made of a definite article and a noun
- "yours" is the possessive pronoun in the predicate
It is your coffee = È il tuo caffè:
- "it" is the pronoun in the subject
- "your coffee" is in the predicate, made of a possessive adjective and a noun