I'm using the Arduino IDE to program my ESP8266, so at the end of my loop, I insert

void loop() {
// other code in my sketch

ESP.deepSleep(60e6);
}

Which puts the ESP8266 to sleep for 60 seconds, and then reboots, running through my code once more before going back to sleep. This greatly extends my battery life. You can change the 60 to whatever number of seconds you want the unit to sleep.