Stage boundaries

Hello exactly how do I add boundaries or some kind of listener to my stage?
The size is:
x = 900
y = 900
im looking to end my game if the player moves beyond the screen area.