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 and Ground Pounds it, Blue Coins show up nearby. Mario has a short time to gather the Blue Coins, after which they disappear. The block cannot be reused. The amount of Blue Coins that appear varies greatly with each course, ranging from two to ten or more. During the time that blue coins appears on the screen, applause can be heard. It ends either when the time runs out, or when Mario collects all the blue coins.