Two-part epoxy is one of the best choices for filling gaps. It doesn't shrink or expand, like some glues, so when you apply the epoxy, it cures in the size and shape it was when liquid. Epoxy can fill in and strengthen a weak or wobbly joint that doesn't fit quite right. It's also handy for filling in joints if they are a mixture of materials, such as wood with metal pegs, since it can help different materials bond together and works with nonporous materials.
If a gap is more cosmetic in nature, consider using wood filler or wood putty. Wood filler is designed for the purpose of filling gaps or imperfections in wood. Some types can be stained, which may help you better match the furniture color to the repair. Smooth the filler into the gap using a flat tool, such as a putty knife, then wait for it to dry. Wood fillers can be sanded, so sand it flush with the rest of the piece. If the gap is large or deep, you may need to fill it by putting some wood shavings into the gap first.
If a joint needs reinforcement and you can't take it apart, an option is to use a plain syringe and force some wood glue into the gap. Wood glue tends to shrink as it dries, though, and is too brittle for large gaps, so you may need to use it in conjunction with a clamp to make a gap as narrow as possible. You also can use thin pieces of wood or even toothpicks dipped in wood glue to fill in a gap, then use more glue to fill in the rest of the area.
Despite the complex-sounding name, cyanoacrylate is a fairly common and easily-found type of glue. It's fast-drying and powerful, so it's handy for mending joints that are difficult to clamp together, or for holding together oddly shaped parts. It's not as good at filling gaps as some of the other options, because it's thin, but it can repair small gaps and fix joints that need a little adjustment. Add some dust from sanding into the glue to hide it, making the repair blend more seamlessly.