더위 먹다 means "have heatstroke" (热射病) and it is not an informal expression.
But we can use it in a different meaning like slang when we are kidding or laughing at someone as in your sample "더위 먹었니?".
In this case, its meaning is are you out of mind, are you insane or something so.
That is, if you think your friend is talking nonsense, you can say to her/him, 더위 먹었니?
It could sound rather cynical.