To put the ESP8266 in deep sleep mode, use ESP.deepSleep(uS) and pass as argument sleep time in microseconds. GPIO 16 must be connected to reset (RST) pin so the ESP8266 is able to wake up.
To put the ESP8266 in deep sleep mode for an indefinite period of time use ESP.deepSleep(0). The ESP8266 will wake up when the RST pin receives a LOW signal.