There's always a limit. Surrounding that limit is a grey area.
If I do 99% of the homework for you, and let you fill in the three obvious blanks, it's cheating.
If I explain the concepts and you apply them, it's not cheating.
If I help you through the first couple problems, then let you do the next five problems with minimal help, then by the end of the twenty-problem set you're doing them by yourself, it's "cheating", but not really.
Why? Because the point of homework is to learn.
If my helping you prevents you from learning, then it's not helpful, and I'm depriving you of the knowledge you're supposed to be gaining. If making you do it completely on your own prevents you from learning because you just stare at a blank page for an hour and give up, that's not helpful either.
Ideally, teachers would teach and that would be enough. But sometimes, students aren't quite there yet, or teachers have the wrong teaching style for that student, or teachers rush a bit too much, or some outside problem distracts from the teaching. At that point, outside help can be needed.
Now, I could take the time to create a lesson plan, invent my own homework problems, etc. That would be better, and is what I tend to do with my nephews. But they're in grade school and junior high, and I can do most of their homework in my sleep. And the homework tends to only have one or two problems of a given type.
When it comes to higher-level stuff, I'm not going to always know it as well, or have the time to invent new problems out of the blue. At that point, the goal is to get you to understand enough to get through the problem yourself, with the understanding that you'll probably get tested on this later. If you're struggling with the homework, there's a good chance you're going to struggle with the test, so you should probably get more help between now and then.
Note though, that there's a huge difference between "do these 20 nearly-identical math problems before doing 20 more tomorrow" and "conduct a semester-long, scientific study of bugs that takes dozens of hours for one report". Me doing three of your problems for you on the former is of little consequence if it helps you learn, while doing the only problem for you is half your grade on the latter.
There's also a big difference between the student who hasn't even bothered reading the text, and the student who's spent 20 hours on the first problem and gotten nowhere. Clearly, the first student needs to put reasonable effort in, while the second student either needs to go back and do the prerequisites, or get a teacher who does better with homework assignments (and that isn't hypothetical: I've had homework not even the teacher knew how to accomplish, and homework that had nothing to do with either the lecture or the book lesson).
A typical scenario falls somewhere in the middle of those extremes where reasonable help is reasonable. And in general, everyone gets help with graded homework in subjects they're less familiar with (and most homework is graded). I don't think I've ever seen a course where anyone would even blink at getting help as long as the student did most of the work themselves. Especially when there's a test that counts for far more points where the student doesn't get any help at all.