If you are not sure which to use, it is usually safer to use have to.
You can use must to talk about the present or future, but not the past:
We must go now.
We must go tomorrow. (but not `We must go yesterday')
You can use have to in all forms. For example:
I had to go to hospital. (past)
Have you ever had to go to hospital? (present perfect)
I might have to go to hospital. (infinitive after might)
In questions and negative sentences with have to, we use the auxiliary verb DO (do/does/did):
What do I have to do to get a driving licence? (not ‘What have I to do?’)
Why did you have to go to hospital?
Karen doesn't have to work on Saturdays.