The new hearts above a Pokemon indicate how much “motivation” it has.
In the new version of the game, all Pokémon in gyms have a certain level of “motivation,” which starts full and is gradually drained the more the Pokemon loses in battle. The Pokémon also just generally loses motivation over time, regardless of whether it’s defeated in battle.
The motivation is not the same thing as CP, although they are connected, as a Pokémon loses CP as it loses motivation. Not every Pokémon does so at the same rate, though, as Pokémon with high CP lose motivation quicker and Pokémon with lower CP lose it slower.
When a Pokémon has lost all of its motivation, the next time it loses in battle, it will be kicked out of the gym. The goal of fighting in gyms therefore has become trying to lower the motivation of all of the Pokémon in a given gym; once you kick out all six Pokémon, the gym can be taken over.
However, a Pokémon’s motivation can be restored by feeding it berries. Any type of berry will increase a Pokémon’s motivation the same amount except for Golden Razz Berries, which bring a Pokémon’s motivation all the way up to 100 percent. However, the Golden Razz Berry can only be obtained through Raid Battles, a feature that is not yet available.
If you want to fully restore your Pokémon’s motivation, though, you can’t just continuously feed it berries. That’s because when you feed a Pokémon multiple berries in a row, the berries provide the Pokémon with less and less motivation. This discourages players from simply visiting their gym over and over again and constantly keeping their Pokémon at high motivations so that no one can take the gym down. It also encourages cooperation, as although you can’t replenish a Pokémon by giving it many berries in a row, one of your teammates can give it a second berry which will provide just as much motivation as the first one you gave it.
Gyms have officially re-opened in Pokémon GO. As soon as players start stationing Pokémon in gyms, they’ll notice that the Pokémon now have hearts above them, with this clearly being some sort of meter that can be drained.