This translates as "Good night", but as you are literally saying "Sleep peacefully", you only use it in the context of expressing that you hope someone who is going to bed soon sleeps well. You don't use this phrase as a way to say goodbye to someone at night.
Well, you use it to your girlfriend's parents or grandparents, or any other elder you happen to see before bedtime. It's a formal version of 잘 자세요 (sleep well).
Sleep tight = Sleep well = Have a good dream = 안녕히 주무세요 = 잘자요 = 잘자 = 좋은 꿈꿔 = 숙면하세요
잘 자세요 => This sounds very weird at least to me since it is in between being polite and casual. For learners of Korean language, I do not recommend the use of such pseud- polite or pseudo-casual form.
Polite form of sleep tight: 안녕히 주무세요 = 잘자요=쉬세요 (Have a rest) Casual form: 잘자 = 좋은 꿈꿔=잘 쉬어 (Have a rest)
a way to say goodbye to someone at night. => 좋은 밤 되세요 (Have a good night)