If someone has
done you a favour and you tell them that you
don't know how to thank them, they could say: "You can thank me
later" in the sense of that you can do them a favour later and help them with something.
If someone does you a favour and you
don't thank them for it and
don't seem grateful, they may say in a joking or sarcastic way: "You can thank me later" as a gentle or subtle (even unsubtle) reminder that you should be grateful to them.
If someone gives you a word of warning or tips to avoid you getting into a crisis and you think the advice is unnecessary, they might say: "You can thank me later" or "you'll thank me later" in the sense that although you
don't take their words/actions seriously now you'll eventually realise that they were
right and will be grateful to them - even if you're not grateful now.