Most dehumidifiers have onboard humidistats that allow you to set a suitable relative humidity for a room. The dehumidifier will automatically cycle on and off depending on the climatic changes and maintain the desired relative humidity level.  They automatically shut off once it reaches the set relative humidity level.