As the shurikens are being thrown at you, you need to press the appropriate arrow key to dodge them. They come in increasingly fast, so you need to be fast on your fingers to complete it.
And even if you can't get the boss on each stage, the game isn't over, you just lose some health points. Hope this helps!