Code stops after some time using delay

Do not power the servos from the Arduino. Set up a separate power supply. I have seen where an sg90 can draw 550 ma.