Usually there is a small screw on the outer side of the frame, you can unscrew it and then put the lenses back into the glasses, and wring the screw firmly back. Or you can hold the frame steady and then push the lenses back with force. Try more times, you will succeed eventually.
It seems depending on what material of your glasses frame is. There are usually metal frames and plastic frames on the market. First of all, you should check carefully of the lens and frames to see if any crack or breaks or chips. As to metal frame, there are some screws. You can loosen the screw which is supposed to hold the lens in place. You don't need to take it out completely. If you did, put it away carefully because it is too small and easy to get lost. Put the lens in the groove of the frame, which has an edge fitting into the rim. After input the lens, hold it closely with one hand, and tighten the screw carefully. If it is a plastic material frame, the first step is the same, inspection of any cracks or breaks. Then you need to put the frame into warm water so make the frame softer than usual. Take the frame out of water after 1-2 minutes and place the edge of the lens into the groove of the frame. Hold it tightly and press the other side of the lens into the groove. Finally check if the lens is properly and completely placed into the groove of the frame.
Usually the lenses are very tight in the glasses. You need to find the fire and heat the frames for a while. But you should control the distance and not let the lenses get damaged. Then you will find the frames of the glasses become loose. At this time, you could pop the lenses back into the glasses.