There is a Kodak publication with guidelines on this here:
Storage and Care of KODAK Photographic Materials
The official line from Kodak is: "While storage in a refrigerator or freezer can be highly beneficial, you should not rely on it to extend film life beyond the "Develop Before" date."
However, acceptable results are widely obtained from film that has been frozen in an attempt to extend its usable life.
Store film in the unopened packaging it comes in. For 35mm film, that means in the plastic canister, and for 120 film, it means in the unopened foil wrapper. This protects the film from moisture in the environment.
Store film in the freezer, rather than the refrigerator. This is critical for C-41/E-6 films. Traditional black and white film is better able to withstand storage at relatively higher temperatures, but for long-term storage, even black and white film should probably be stored in the freezer.
Film cannot be stored indefinitely, because natural cosmic radiation will also have adverse effects on the film, and there really isn't much you can practically do to avoid that. Higher ISO films will suffer damage more quickly in this respect than lower ISO films.
When you want to use film after cold storage, you just need to allow it to fully return to room temperature before use. Refer to the Kodak publication linked above for guidelines on how long to allow for this depending on the film format. Also, wait until the film has returned to room temperature before opening the sealed packaging - otherwise condensation could form on the film.
A good guideline is that freezer storage will lengthen the usable life of film by roughly ten times (for slower films of ISO 100 and below). So if a film has an expiration date two years away, then freezing it will allow it to be stored for up to 20 years and still obtain acceptable results.