It is written in Seforim that if a Mezuzah falls down it is customary to have it checked before it is reaffixed.
If one does not have plans to get the Mezuzah checked, it must be reaffixed immediately (even before putting on Tefillin or davening) with a Brachah if its a location that requires a Brachah.
If however, it cannot be reaffixed immediately, for example if it falls off on Shabbos/Shabbat, you may continue to use the room. The Mezuzah should be picked up in an irregular manner, i.e. with a spoon and put aside in order to be put up right after Shabbos.
Practically speaking, before you put it back up you should check that it was attached properly, such as with screws, nails or double-sided mounting tape. If it wasn’t make sure it is re-affixed properly.