regular/simple hinges on glasses are a tiny brass ring on one side, and a double ring on the other. A screw goes through them. Take a look at it now. Let me see if i can draw it.
Your hinge may not look like this, if that is the case then this probably won't help you.
The hinge on the frame has a slot for the arm-hinge-ring to slide into. Sometimes the ring either side of this slot is 'too open'. It happens from the arm being pushed in a direction it's not meant to go, leveraging the hinge apart. It can create the scenario you are experiencing.
FIRST: check, see if this description matches. If it doesn't, that's okay, sorry I couldn't help further.
SECOND: sometimes attempting to gently over tighten the screw is enough to bring these close together. This is risky though, it's easy to damage and glasses aren't forgiving.
THREE: remove the screw, set it somewhere safe like deep into the carpet or a rug (joking) Take some fine needle nose pliers and VERY GENTLY squeeze together the brass hinge. You need to be very careful here as we are stressing the metal. We only want to close that gap by a tiny tiny tiny amount to remove the looseness. Squeeze too hard and the hinge will collapse and then it's completely ruined.
Bending metal like this, a brute way, weakens metal. The atoms which are part of the bend harden, Hard metal tends to crack, tear, snap, break. What you're about to do is delicate, and you only get a few tries at this before it will break from the metal hardening. Be careful, but don't feel too bad if this happens.
FOUR: replace the arm hinge half into the slot. You should feel some resistance, just barely any is enough.
FIVE: put a teeny tiny amount of glue on the thread of the screw. It doesn't need to be special or expensive glue. paper glue, craft glue, child snot. The point of the glue is to help harden the screw thread into the glasses, preventing the screw from creeping out. Superglue is too much. If you're stuck for an idea lick your fingers, touch sugar, rub your fingers together with the screw. That's plenty of glue. This step is optional.
6IX: put the screw back in, tighten it to the point where you are happy with the tension of the arm. Lick the sugar from the hinge.