とき is a conjunction meaning “when,” so うちにかえるときでんわしてね and うちにかえったときでんわしてね both means "when you return home, please ring me."
The aesthetic difference is
うちにかえるときでんわしてね has かえる (non-past plain) before とき and
うちにかえったときでんわしてね has かえった (past plain) before とき.
When a “non-past plain” verb is used before とき, that means the action of that verb has not been completed when the action of the verb after とき happens. In short, うちにかえるときでんわしてね means "Please ring me when you are coming home" or "Please ring me when you are on the way home."
On the other hand, when a “past plain” verb is used before とき, the action of that verb has to be completed when the second action happens. So うちにかえったときでんわしてね means "When you are back home, please ring me" or "After you get home, please ring me."