From the Super Mario Wiki
The game's purpose is to get the bubble inside the blue path located in a yellow circle. When done so, the player has to get it out in the opposite direction. If done correctly, the game is won. However, if it hits the yellow part, it'll pop and the player will lose the game.