Gadgets are incredibly effective inventions created by Peter Parker. The hero uses them to fight enemies - Spider-Man is able to use electricity grid, throw back his enemies, or create traps that catch and attract enemies. Unfortunately - each gadget has a certain number of uses and you really have to learn to use them when necessary. The following chapter of the Marvel's Spider-Man game guide describes how the gadgets renewal process looks like.
When it comes to gadget regeneration, it depends on time - after using up the ammunition, you have to wait a while until the item is ready to use it again. If you use one of the gadgets particularly often, you may want to consider of making an upgrade that, for example, will increase the maximum ammunition capacity. Peter's inventions work especially well when you fight with special enemies, such as brutes or enemies with whips.
Additionally, after completing a certain number of main plot's missions, you can mount an upgrade to your suit - "Scavenger", which provides additional ammunition to gadgets after finishing an enemy. An even better idea is the "Metabolic Converter", which gives you a chance to produce ammunition when Spider-Man takes damage.