Don’t is a contraction for do not and doesn’t is a contraction for does not.
Thus:
Don’t = Do not
Doesn’t = Does not
Don’t and doesn’t are generally used in negative and interrogative sentences:
i) I don’t like rice.
ii) Sudhir doesn’t eat meat.
iii) Why don’t you free some time for me?
iv) Doesn’t he understand how much her mother is sacrificing?
Now, the critical rule which determines where to use don’t and where to use doesn’t:
Use don’t with first person (I, we), second person (You) and third person plural (They).
Thus:
i) Don’t you know when we are leaving?
ii) I don’t understand this logic.
iii) They don’t want to come.
iv) Why don’t we ever agree on anything?
Use doesn’t with third person singular (He, she, it):
Examples:
i) He doesn’t like her.
ii) She doesn’t want to go to Delhi.
iii) It doesn’t have to be cash. You can pay by cheque too.
iv) Doesn’t Sudhir understand the point?