AP,aka ability points, are used for leveling skills up in the skills window. Depending on your level and what the next level is, you will get a specific amount of AP. The only other way to get more is with an item, or from a double/triple AP event.

Level 1 - Level 2:

Level 2 - Level 3:

level 3 - level 4:

level 4 - level 5: