Deber and tener que are generally interchangeable. However, tener que is normally used to express what someone has to do and whatever that is, is not totally dependable on the person but on "external factors"; Deber is also used to express what someone has to do but this obligation is more of a moral obligation and it depends on the person, not external factors. Here are two examples with a bit of context:
"La estación de trenes está bastante lejos. Si quieres llegar a tiempo, tendrás que coger un taxi." (The train station is quite far. If you want to get there on time you will have to take a taxi.)
Here I used "tendrás que" because there are external factors (the train station being far a way).
"Antonio, debes ser más generoso con tu hermano." (Antonio, you have to be more generous with your brother.)
Here I used "debes" because it is more of a moral obligation and it is totally dependable on Antonio.
We tend to use "tener que" a lot more than deber though.
I hope this helps