Yes, you are right. You can use it as a way to say goodbye, whether you're a clerk in a store or if you're saying goodbye to people with whom you have a friendly relationship. The only "requirement" I can think of is that the people to whom you are saying it to have to be the ones that are leaving, ha ha ha. You wouldn't say "Que te vaya bien!" if you're the one leaving his or her home to return to your place. But other than that, there is no special situation. Another thing I can say is that this way of saying goodbye is used especially if the people you're saying goodbye to are making a trip, but can be used if they're just going home or away from you for the day.
And you have the uses for each pronoun right, too:
"Que le vaya bien." is used for "usted", the "formal you".
"Que te vaya bien." is used for "tú", the "informal you".
"Que les vaya bien." is used for "ustedes", which is "you" in plural, and you say it the same way for a group of boys, a group of girls, or a mixed group.
Hope this helps!