Write this in your world class :
private int timer = 7200; // roughly 2 minutes ( each minute is 3600 act cycles)
then this in your act method
public void act() {
showText("Time left: " + timer/60, x, y); // replace x and y by where you want the timer placed
if (timer > 0) {
timer--;
if (timer == 0) Greenfoot.stop();
}
this will display the timer in second