Is there an app to stop masturbating?
Here is the honest answer up front. No app can block the act of masturbating, and any app that promises to is overselling. What a good app does is block the trigger, usually porn, and give you a plan for the urge. That honesty matters, because it is also the part that actually works.
Why software cannot block the act
A blocker works by refusing to load a website. It has no way to stop a physical action, and it should not pretend to. So a real masturbation blocker is two things put together. It blocks the porn that usually starts the urge, and it gives you something to do in the moment the urge hits.
What actually helps
Block the trigger. Porn is the trigger more often than not, so removing it from one tap away lowers how often the urge even shows up. Escape's Safari blocker is free, needs no account, and blocks 40,000+ known sites the moment you turn it on. It never sees or stores what you block, because that stays on your phone. The iPhone guide covers the full setup, and the free options are laid out plainly.
Then have a plan for the urge itself. One thing you always do, before you decide anything. Stand up, delay two minutes, change rooms. Escape's panic button is a built-in version for the moment you are about to slip.
If the habit is the masturbation, not the porn
Then the blocker matters less and the urge plan matters more. A physical interrupt and a short delay do most of the work. One thing worth knowing. A chronic, high-pressure technique can reduce partnered sensitivity over time, something people call death grip, and easing off usually helps. None of this needs shame, and none of it needs an app that lies to you. The blocker, the panic button, and a private day counter are all free to start in the Escape app, no account.