A dehumidifier is a refrigeration appliance but instead of getting really cold to chill other things (like food in a refrigerator, etc.), it is only designed to make its evaporator (cooling) coil just mildly cool. This 'mildly cool' is just below the "dew point", the temperature at which ambient humidity in air condenses into a liquid like occurs on the surface of a cold drink glass on a humid summer day. That condensed humidity appears as 'sweat' on the unit's evaporator which then little by little drips down into the dehumidifier's storage bin until disposed of down a house plumbing drain.
If the evaporator coil is frosting over instead of just sweating like it should, there will be no drippings to be collected as the moisture will instead remain held in a frozen state as frost. Also, the more frost on the coils the less room air can reach that coil to have its humidity extracted, resulting in reduced (and eventually nonexistent) dehumidification. Without dehumidification taking place most units will usually run nonstop.
The most common cause of complete and even frosting of the evaporator coil is too cold of ambient room temperature. Most dehumidifiers are not meant to be used when the room temperature drops much below 70°F and certainly not below 65°F (depending on humidity level). There are however some models called "basement dehumidifiers" (see the link below) which are and could be used in cool room conditions.
If the room temperature is borderline, you can try elevating the unit off the floor into the warmer air higher up in the room (remember, hot air rises). I've also heard that an external fan blowing additional air into the unit can help in some circumstances.
Another possible cause of complete frosting is poor air flow through the unit. If the fan motor is not turning fast enough (or at all) or the evaporator, condenser or filter (if used) is plugged with dust, dirt or pet hairs, either could result in restricting the necessary air flow.
A dehumidifier should not be operated when the coils are totally frosted over. This condition can result in permanent damage to the compressor which is the heart of the unit and in most cases making it uneconomical to repair.
Some dehumidifier models have a built in 'de-ice' control which will shut the compressor down when frosted over before damage can occur to the compressor. While this may still produce some recovered moisture (when the compressor shuts off the frost will melt and drip down) it will not dehumidify as well as intended. If your room requires dehumidification but a standard dehumidifier in proper working order has a tendency to frost over, a "basement dehumidifier" model may be able to be used instead of a regular model to achieve proper and consistent humidity control.
Identifying a refrigeration system problem
A problem with the refrigeration system of a dehumidifier can usually be identified by a partially frosted evaporator coil which would usually indicate being short of refrigerant or a failing compressor. If the evaporator is not getting cold at all when the compressor is running, that is a sign of being totally out or refrigerant or of a faulty compressor.
Compressor not running
If the compressor totally fails to run, no cooling and hence no sweating (nor frosting) of the evaporator coil can take place. In such a case the problem could be at the on/off switch or humidistat not switching power to the compressor, the compressor relay, overload protector, start capacitor (if used) or the compressor itself has failed. Power to the compressor would have to be traced to see where the stoppage was.