Can someone help me to understand the difference between these two. From what I understand they both mean "Where do you live?"
Just that the first one is the polite version, used when you're talking to complete strangers or people in positions higher than you, or who are older than you.
"Doko ni sunde imasu ka" can be used with respect to the sets of people as mentioned above but it is simply lesser in its formality compared to the first one, but is respectful and polite nonetheless.
Any standard Japanese learner would be using the second version, and I think that the first one would be used by those who've been using Japanese for quite a good while now and who know some business-Japanese as well <-- This, I mean in the case of foreigners who are Japanese students.