Coins are awarded when you complete a level. The more moves you have left when you complete a level, the more coins you can win.
You can use coins to purchase more lives by tapping on the Heart Store in the upper left of the game screen. You can also use coins to get extra moves if you don't complete a level in the moves allotted.