Despite carefully securing a plug in an outlet, many times I find that the plug falls out minutes after the fact (it happens all the time with things like phone chargers). I have been careful in making sure that the cord is loose enough so that it is not tugging on the plug in any way, yet this still happens. How can I prevent plugs from falling out of a wall socket?
If the outlet has two spots, use the lower spot; it usually provides better friction. As a janitor I always used the lower spots for carpet cleaners and other equipment with heavy cords.
For a loose plug that you don't put in and take out a lot (e.g. the plug for a table lamp), try bending the prongs of the plug slightly apart. This will increase the friction holding the plug in place. Be careful not to damage the plug. Don't try this with your iPhone charger.
For a small adapter like an iPhone charger, you can use a Post-It note to affix the cord to the wall above or below the outlet, which will reduce the amount of torque applied to the plug itself, and may even help hold it up.
For large wall-warts (a.k.a. AC adapters) it is often more convenient to plug a power strip or even a simple extension cord into the wall and plug the AC adapter into the power strip. For a very large adapter, you can even put the adapter on its back and sort of plug the power strip down onto it.
Replace the receptacle. It's starting to fail.
Learn what "break off tabs" are, and look for them.
The receptacles should be able to hold a small wall-wart. If it can't, then the thing falling out is the least of your problems. A poor gripping connection will also cause series arc faults, which will create heat and potential fire. It will cause galling that will damage the prongs and the socket, making further connections worse still. The saving grace is that it's a series arc fault, so the fault can't draw more current than the device does. But plug a heater in there later, and you could have big trouble!
So shut the breaker off (check both sockets for voltage) and pull that receptacle. Take some photos first. Get a $3 Leviton ProLine or similar unit, not the 75 cent cheapies.
Check the "break-off tabs" on both sides, realizing brass screws are a different side than silver screws, and match them on the new one. Then remove the wires from the old socket (loosen screws or stick a paperclip in the backstab release, or just twist it out of the backstab) one at a time and move them to the new socket exactly as you found them.
Do not attempt to upgrade to a USB socket or GFCI without first coming over to diy.stackexchange.com with pix of what's there. Those fancy outlets wire up very differently than normal sockets, and the differences cause lots of wheel-spinning and frustation for a novice. Better to ask first, wait a day, read, breeze through the upgrade.
Lastly, don't destroy position information. Wire location matters. If one white is with some blacks, that kind of thing is a Rosetta Stone. Don't tear all the old equipment out and post a picture like this, it won't end well. (Colors don't indicate what wires do). Colors are becuase of how cables are made, not what wires do. Take photos before you unhook anything. Do that and 95% of the time it'll go smoothly, and the diy stack can sort out the other 5%.
A small piece of double-sided sticky tape will hold the plug in place.
If you use a small piece, then it will easily come off when you want to remove the plug.
If you want to leave the plug in place for a longer period, I use a slightly larger piece of foam-filled tape - which you can sometimes find in pre-cut patches.
If you can't find that in the shops, old-fashioned draught excluder tape will do. This padded sort of tape will hold more firmly and will better absorb knocks to the plug.