If I want to say: “He is their son”, which is correct:
Er ist ihr Sohn.
Er ist deren Sohn.
What is the difference (if any) between ihr and deren in the meaning of their?
Deren
or dessen
are used to prevent misunderstanding concerning possessions in sentences with more than two persons or two groups of persons.
In your example it actually doesn't matter, but try to figure out who are the parents of the son in this sentence: Sie haben ihre Freunde und ihren Sohn eingeladen
. The son could belong to family 1 or family 2. But using Sie haben ihre Freunde und deren Sohn eingeladen
it's clear, the son belongs to their friends.
deren
turns to derem
in case of Dativ, but it does not.
The difference is that deren here is a demonstrative (it can also be a relative pronoun), so this can be roughly compared to the difference between them and of those in English:
Er ist ihr Sohn. – He is their son.
Er ist deren Sohn. – He is the son of those.
Therefore the usage of deren is unusual. Right now, I can think of only three reasons to use it:
Er ist deren Sohn.
sound disrespectful you'd need to put emphasize on deren for pronunciation.
Genitive: dessen (m) - deren (f) - dessen (n) - deren (pl)
Dative: dem (m) - der (f) - dem (n) - denen (pl)