Materia is the skill system of the game, the amount of materia slots available to use will depend on the armor and accessory currently equipped as all equipment (except weapons) have a specific amount of materia slots on them, there are different materia colors depending on what type of materia it is and what it can do.
Magic Materia
Green materia represents magic materia, these materia will give its user magic abilities such as Fire, Thunder, Poison, Barrier, etc that can be used in battle and some that can even be used outside of battle, such as Cure to heal yourself.
Physical Materia
Yellow materia represents physical materia, these materia will give its users different physical skills, some of which will require specific weapons to use, so make sure you read up on them in your skill menu if youre unsure.
Utility Materia
Blue materia represents utility materia, these are special materia that grant special abilities that dont fit into the above two categories, one such materia is Teleport, which lets the user flee from battle with a 100% success rate and also grants the ability to teleport to your respawn point when used outside of battle.
Stat Materia
Purple materia represents stat materia, these materia give stat bonuses such as atk up or hp up instead of a skill or ability.
Upgrading Materia
You can also upgrade certain materia, doing so requires AP, how much AP you need will depend on the materia and its grade, enemies will drop AP the same way they drop Gold and EXP, however, there is a limit to how much AP you can have at one time.
To upgrade materia with AP, find a materia upgrader, they will be located in most towns and sometimes other areas aswell.