Age is the least reliable guide there is — two twelve-year-olds can be several sizes apart, and both are completely normal. Take two measurements instead: around the chest at its fullest point, and around the hips at their widest. Those numbers will tell you far more than a birthday will.
Sleepwear should sit relaxed, never fitted. She will be turning over, warming up and cooling down through the night, so a little extra room is comfort rather than sloppiness. If she falls between sizes, size up — growing girls catch up within a season.
The waistband matters most. A soft, wide, covered elastic that never digs in at the ribs or hips is the difference between pajamas she reaches for every night and a set that quietly stays in the drawer.