In order to max a affinity level of a spirit, you have to level them up until it reaches 9 hearts. There are many ways of leveling up, you can feed them on the bond sub menu, pet them, and play some mini-games. Another great way of improving how much affection it gains is before creating a spirit, there's a possibility to add a command to it. This gives some power ups to the specific spirit created. Choose "Dream Candy" and it will automatically give 3 free affinity hearts. Another way of improving is after each drop, choose the "Affinity gain" before dropping to the other character, it increases how much affinity it will gain by using them in battle and doing all the actions mentioned.