From the Super Mario Wiki
The Blue Coin Block is an object found in Super Mario 64 and its remake Super Mario 64 DS.
When Mario finds a Blue Coin Block, he can Ground Pound this object. After doing so, Blue Coins show up nearby. Mario has a short time to gather the Blue Coins. When the time is up, the Blue Coins disappear, and the block cannot be reused. The amount of Blue Coins that appear varies greatly with each course, ranging from two to ten or more. When getting all of them, applause can be heard. Blue Coin Blocks are a great way to get closer to gathering 100 Coins in each course; an accomplishment that rewards Mario with a Power Star.