As explained in my answer to another question, "haber que" (hay que, habrá que, etc.) are impersonal verb forms, which means that they do not have a subject. They express a general obligation and mean something similar to "it is necessary to...", as explained on DLE (seventh meaning). For example:
- Hay que hacerse un test de COVID para poder entrar en España (It is necessary to take a COVID test to be able to enter Spain)
On the other hand, both "tener que" and "deber" are conjugated, i.e., they have a subject. They are used to talk about an obligation that applies to a specific person or group, and are equivalent to have to/must:
- Tengo que hacerme un test de COVID para poder entrar en España (I have to take a COVID test to be able to enter Spain)
Regarding the difference between "tener que" and "deber", DLE says about deber:
- tr. Estar obligado a algo por la ley divina, natural o positiva. U. t. c. prnl. Deberse a la patria.
- tr. Tener obligación de corresponder a alguien en lo moral.
- tr. Cumplir obligaciones nacidas de respeto, gratitud u otros motivos.
and about tener que:
- tr. Denota la necesidad o determinación de hacer aquello que expresa una cláusula posterior introducida por que. Tendré que salir.
This means that "deber" expresses obligations that are due to moral, religious, or legal reasons, or a self-imposed feeling of obligation (for example, due to gratitude). "Tener que" denotes an obligation due to necessity or determination.
As you might see, the difference between these two is small, and in many cases they are used interchangeably. You can say
- Debo estudiar más el año que viene
and interpret it as a self-imposed obligation, or you can say
- Tengo que estudiar más el año que viene
and interpret it as determination. While the version with "tengo que" sounds stronger (to me), there is a fine line between "self-imposed obligation" and "determination".