The longer the fight goes on the more damage you'll do to him with each hit, and he will eventually concede defeat. Choose to spare him, and Flowey will make an appearance.
Should I spare or fight Flowey?
Killing Flowey at the end does not count against your Pacifist playthrough. ... The only argument against killing Flowey at this stage is as confirmation that you've done everything, since Flowey will give you a hint about what to do next to get the True Pacifist ending. It's your decision, though.
Does killing Flowey ruin a pacifist run?
If you completed a true pacifist route to the point where Flowey captures all of the protagonists friends,then you are not able to kill Flowey.