From the Super Mario Wiki
A Recovery Block (also known as a Heart Block or an HP Block) is a type of block seen in the Paper Mario and Mario & Luigi series of Mario role-playing games. These blocks are commonly found in areas where a Save Block is present and before the player enters a boss area, and fully restore the player's refillable stats when struck.
Paper Mario series
In Paper Mario, Recovery Blocks are transparent blocks with a heart floating in the middle of the block. There are multiple different ones scattered throughout the game, each one refilling all of Mario's HP and FP when hit.
Paper Mario: The Thousand-Year Door
Recovery Blocks return in Paper Mario: The Thousand-Year Door, only now, it costs Mario a few coins for the health benefit, indicated above the block. The amount of coins required increases as one progresses through the game. Their design is very similar to that of their design in Paper Mario. These blocks are usually, if not always, found right before a boss fight, and right when Mario enters a new area such as Hooktail Castle.
Paper Mario: Sticker Star
Recovery Blocks reappear in Paper Mario: Sticker Star, though they only fully recover Mario's HP. They function the same way as they do in Paper Mario, allowing Mario to use them at any time for free.
Mario & Luigi series
Mario & Luigi: Superstar Saga / Mario & Luigi: Superstar Saga + Bowser's Minions
In the Japanese version of Mario & Luigi: Superstar Saga only, Recovery Blocks appear in three locations; the Beanbean Castle Sewers, Oho Oasis, and Teehee Valley. They are white blocks with a heart in the middle of the block. When hit, these blocks fully recover Mario and Luigi's HP and BP. The Nintendo 3DS remake of the game, Mario & Luigi: Superstar Saga + Bowser's Minions, retains the block in all versions of the game, and they are found in many more places, typically wherever there is a Save Album.
Mario & Luigi: Partners in Time
A few Recovery Blocks are found in Mario & Luigi: Partners in Time, though they are almost as scarce as in the Japanese version of Mario & Luigi: Superstar Saga. Their design in this game is that of a blue block with a heart symbol in the middle of the block. There is one in Peach's Castle in the present, one inside Yoob's Belly, and one just before the throne room of Shroob Castle. As in Paper Mario, they are free to use.
Mario & Luigi: Bowser's Inside Story / Mario & Luigi: Bowser's Inside Story + Bowser Jr.'s Journey
In Mario & Luigi: Bowser's Inside Story and Mario & Luigi: Bowser's Inside Story + Bowser Jr.'s Journey, Recovery Blocks are replaced with Shop Blocks that can only be activated by Bowser's punch. These blocks can release Negative Ions that fully recover Bowser's HP and SP/BP. Orange-colored Emoglobins that are found in a few locations of Bowser's body, like the Trash Pit, secrete sweat that instantly recovers all of Mario and Luigi's HP and SP/BP.
Mario & Luigi: Paper Jam
They make a return in Mario & Luigi: Paper Jam. They appear to be a rainbow-flashing rectangular block with a heart on it. Also in the game, they are more common. They are usually placed near locations where bosses are fought (like near the giant door to the summit of Mount Brrr which is where King Bob-omb is fought), and also in Toad Villages. If hit, the trio does not only restore HP and BP, but also restores Paper Mario's copies.