Technically, P2 does not directly respond to P1. There is some implied extra meaning hidden in P2's first sentence. When P2 says "Sorry. I had to go home", they mean "Sorry. I had to go home, so I will not be able to go to the cinema."
(I am assuming you meant P2 in the second group of sentences where you have P1.)
The second group would turn out something like:
P3: Did you go to the cinema yesterday?
P2: My friend invited me, but I had to go home.
It's the same conjugation ("had"). Why? Because both sentences are referring to the past — in both cases, P2 has already had to go home before they speak. Therefore both sentences can use the same conjugation.
For the third pair of sentences, you could complete them with:
P1: Will you go to the cinema tomorrow?
P2: I want to go, but I have to go somewhere else instead.
"Have" refers to the future here; "I have to go somewhere" means "In the future, I will be moving to a different place that prevents me from going to the cinema with you."
If you want, you could also write:
P2: I want to go, but I will have to go somewhere.
This indicates more strongly that P2 will be leaving for "somewhere" at an indiscriminate point in the future. (Note that not specifying a specific location here would be seen by a native English speaker as P2 rudely attempting to get out of going to the cinema with P1.)