Here's a breakdown:
* por qué: why
* no: not
* te: you (informal)
* duermes: sleep (you, present tense)
* un rato: a while
The sentence is a suggestion or recommendation for someone to take a nap. It's often used in situations where someone is tired or appears to be struggling.