From the Super Mario Wiki
Star Blocks appear in Super Paper Mario. As the name implies, they are blocks with a star inside. They serve as goals for every chapter in the game. After one of the four heroes hits one of these blocks, the chapter will end, and the player will have the option to save. After that, there is a short narrator segment, then the next chapter will start (or, in the case of any chapter-4 levels, the player will return to Flipside).