A toilet paper holder gets a lot of use, and it isn't unusual for one or both of the arms that support the rod holding the roll of paper to work themselves loose. If you have a small screwdriver, you can sometimes fix this in a second, and a simple trick can prevent a recurrence. Sometimes screws work themselves out of the wall, and that's also something you can fix in a jiffy.
Considering how simple a toilet holder is, the number of variations is amazing. A common design consists of two arms supporting a spring-loaded rod that fits between them. The support arms may be attached directly to the wall or to a square plate that fits onto the wall surface or into a recess. These can be fabricated from a single piece of ceramic, plastic or metal, but sometimes the support arms are attached to the main body of the holder with screws or spring-loaded hinges. A third type of holder consists of little more than a curved or bent rod attached to the wall; the paper roll fits over the rod and turns freely.
Support arms that appear to be attached directly to the wall are actually mounted on plates screwed to the drywall or wall studs. A set screw secures each support arm to the plate, and often all you have to do to stabilize a loose one is to tighten that screw. You can't see it because it's on the underside of the rim of the support arm, and you usually need a small flat-head screwdriver or hex wrench to turn it. A simple trick that prevents this set screw from working its way out again is to spread a small amount of thread-locking compound on the threads before tightening it.
If the support arm still wiggles after you've tightened the set screw, it's because the mounting plate is loose. Unscrew the screws holding this plate to the wall, and you'll probably find a loose wall anchor or, worse, no anchor at all. It's a fairly simple matter to extract the anchor and replace it with a larger one -- be sure to tap it in until the front flange is flush with the wall. If there was no anchor, and the screws weren't attached to the framing, tap in an anchor that fits snugly in the hole. Complete the repair by reattaching the plate with a screw with a larger gauge than the one you removed.
The support arms on one-piece toilet paper holders don't loosen easily, and when they do, you have to remove the holder from the wall to tighten them. You'll find screws directly behind the paper roll, and after loosening them, you can pull the holder off the wall. Turn it over to tighten the screws holding the support arms. If the anchors holding one of the support arms on your two-piece holder have come loose, consider shifting the position of the holder so that you can attach that arm to a stud. You can easily patch the original holes with spackling compound.