DD did this at the same age. We got her a toddler clock and she eventually understood that she would need to be in bed the clock told her otherwise.
Took us awhile to get the clock and to train her (2 weeks of training at 24/25 months). And between that she usually just got put back in bed repeatedly or made to lay in bed with us.
SAHM to Magnolia May (09/10) and Luke Russett (04/13) and wife and best friend to my airman.