As a 50 year old native U.S. speaker who cares about using "proper English" (without being a professional writer or grammar professor), this sentence does not faze me in the least. In other words, I think it is perfectly fine.
I don't see a definitive answer to your question, as currently phrased, so I'll just take a stab at some other versions. There are things to be gleaned here.
"Please tell me how much you paid when you come back from the dentist." -- just sounds more polite, less like a command like the original, but nothing to do with "formal/informal."
"When you come back from the dentist, please tell me how much you paid." -- just switching the clauses works when also separated by a comma there. My reason for switching would be to prepare the listener for "when" I'm asking them to do something (i.e., not now), before they hear "what" I'm asking for. Unless I wanted them to hear the "what" first, then the "when."
Off-the-cuff, I honestly don't see a way to make this one more formal, and the only way I see to make it more "casual" is to replace with slang or otherwise make it sound less educated, like:
"Hey! When you get back from that tooth doctor, let me know what the damage was." :D
Here, let me just offer a few phrase replacement options to consider:
- tell me => let me know -- makes it more casual
- tell me => inform me -- makes it sound more formal, but overly "stuffy"
- come back / get back => return -- makes it sound slightly more educated
- paid => what the damage was -- not "the damage" to one's teeth; this is American slang ... "What's the damage?" is somewhat common in all money situations for "How much did you lose in the transaction", i.e., "paid." And ending any sentence with the "to be" verb ("was") is very casual, but it goes well with "the damage" here.
- dentist => tooth doctor -- just some humor, only someone so uneducated who literally does not know of the word "dentist" would use that :D (so don't you do it!)