When you rub your Pokémon, you get hearts. A heart can also be earned by giving your Pokémon Poképuffs.
The actual hearts are determined by "Affection Value", going up by the fifties:
Affection Value = Hearts Required
One Heart = 1
Two Hearts = 50
Three Hearts = 100
Four Hearts = 150
Five Hearts = 250
As for Poképuffs, there are a few variables.
> There are five PokéPuff flavours: Mint, Citrus, Mocha, Spice and Sweet, with each Pokémon having their own preference. This varies depending on each individual Pokémon, and not species. In addition to that, there are four different categories for each PokéPuff: Basic, Frosted, Fancy and Deluxe, which can be denoted by the various topings on the top of them. The better the category, the more affection you will receive from your Pokémon.
>In addition to that, there are more PokéPuffs to be found: Supreme PokéPuffs. Many of these can be given to you via friends on the Pokémon Amie screen, but others are given as a special gift in various circumstances
Name = Location
Supreme Wish = Get given it on your birthday.
Supreme Honour = Defeat the Elite Four.
Supreme Spring = Defeat a mini-game with 5 stars.
Supreme Summer = Defeat a mini-game with 5 stars.
Supreme Autumn = Defeat a mini-game with 5 stars.
Supreme Winter = Defeat a mini-game with 5 stars.
Pokémon Amie also has effects in-battle, that you can read more about and learn about mini-games as well from the source.