"The time" means some specific time, probably mentioned previously. "Your time" means "the time you have (available)", without any need of context. Italian works in the same way for this.
On the other hand, in English the second "your" cannot be avoided, but in Italian it is best avoided, because there is no need for possessives between definite articles and usual places/people.
- il tempo = the usual time, probably time in general or previously mentioned
- il tuo tempo = the time you have (available)
- i tuoi amici = your friends in contrast to someone other's friends
- i amici = your usual/only friends
yes, you are right:
Spend you time with your friends! = Passa il tuo tempo con gli amici! or Passi il Suo tempo con gli amici! (in this case also the possessive pronoun has to be the formal one).
There is no rule. Normally you have a context; addressing a certain person (formal or informal)