At some point in the main story, an NPC will tell you about Materia and give you a quest to learn more. Follow that quest to find out how to make it and and how to attach it. You need a crafter skill (any except culinarian) at 19 to attach Materia, and you will only be able to attach it to the items from that skill. For example, my leatherworker can only attach Materia to leather items.