Mats are needed to infuse gear. As mentioned in the Decoding / Light section, different color gear has set amounts for maximum perks to infuse. An example (purple weapon) is here:
Note the materials with numbers next to them. These are spinmetal, spirit bloom, relic iron, helium filaments, and wormspore. Each perk requires a specific amount of each material; these are consistent for gear that comes from any color engram. For every infusion, ATK, DEF, ATK%, and DEF% perks require 2x more of each material than the previous infusion, and HP%, GLIM%, EXP%, CRIT%, and EV% require 1x more of each material. NOTE: every infusion increases the amount of materials needed for ALL perks on the weapon/armor piece, not just the perk being infused.
The maximum number of infusions allowed on weapon/gear depends on the color of the engram:
Green(Uncommon): 15 Blue(Rare): 20 Purple(Legendary): 30 Yellow(Exotic): 50
Materials are found on different planets:
Spinmetal: Earth Helium Filaments: Moon Spirit Bloom: Venus Relic Iron: Mars Wormspore: Saturn
They can drop from any regular enemy, and have a fairly high drop rate from Ultras.
Also, there are "Material caches"; these can come in 5 varieties: small (level 1+), medium (level 40+), large (level 60+), XL (level 80+), and mega (level 99). Smalls drop 1 of all five mats; mediums 2; large caches 3; XL caches 4; and mega caches 5. These go a long way in helping you get enough mats to infuse, so be sure to collects these when you can.
Lastly, don't infuse until at least level 60. You want to kill enemies and get as many engrams as possible early on to raise your cryptarch rank, and get better gear. When you begin to hit higher levels and get great gear, it is recommended to infuse at least a small amount (5 infusions for whatever perk) if you are struggling in areas, or need exp/glim/lp etc.