Quedarse vs. permanecer

In Spanish, both 'quedarse' and 'permanecer' can be used to mean 'to stay (in a place)', but they are used in different contexts and have distinct nuances.

Quedarse

'Quedarse' is a reflexive verb that generally means 'to stay' or 'to remain', often implying a more temporary or personal decision or action. It is commonly associated with people and is used in everyday language.
Me voy a quedar en casa esta noche.
(I am going to stay at home tonight.)
Nos quedamos en el hotel durante las vacaciones.
(We stayed at the hotel during the holidays.)
¿Por qué no te quedas a cenar?
(Why don't you stay for dinner?)

Permanecer

'Permanecer' means 'to stay', 'to remain', or 'to continue being', often implying a sense of stability, formality, or duration. It is less commonly used in casual conversation and tends to appear in more formal contexts.
Los pacientes deben permanecer en sus habitaciones.
(Patients must remain in their rooms.)
Ella va a permanecer en la empresa por muchos años.
(She will stay with the company for many years.)
Durante la tormenta, es mejor permanecer dentro de la casa.
(During the storm, it's better to stay inside the house.)

Summary

While both 'quedarse' and 'permanecer' can mean 'to stay', 'quedarse' is typically used for more temporary or personal situations and is common in everyday language, whereas 'permanecer' implies a more formal, stable, or extended presence and is often found in formal contexts.