Creating a successful business can largely be about perservance.
That being said...how do you know when it's time to move on to the next idea?
Not sure if there is a right answer to this. This depends heavily on the context.
My current answer would be: when you have tried really everything you could do to make the business a success, but it simply does not work (= not making revenue). When you have really tried everything, you usually will realize what the problem is. That's when you either pivot, or move on to the next idea.