Why are these 2 words different? Google Translate says they mean the same thing. When would each be used?
Both mean good night, but the shorter one is less polite.
You must use おやすみなさい, the longer one, when you say good night to your guest, teacher, boss, etc. To your family, whichever is fine. Kids are generally taught to use おやすみなさい first, and then they start to use おやすみ somewhere in their childhood.