There could be two meanings for "How long is it on for?" in my opinion.
1> "How long does the play last?"
The answer could be something like "Two hours with an interval after the first hour."
2> "How long is the run?"
(a "run" when we are talking about plays is how many nights the play is being performed for)
The answer could be something like "It's on until the 18th of September."
I think there are more natural ways to ask the question if you want to know about the length of the play ("What time does it finish?" "How long is the performance?") so, without context, I would expect meaning 2 to be more likely.
I'm not really sure why we use "on" in relation to plays, but we also use it for TV shows and films as well. We say "What's on at the cinema this week?" or "Is there anything good on TV tonight?" and "Hamlet will be on at the Globe this season." - any kind of performance, including musical concerts, tends to use on. It's not always required; you can say "There's a great concert (on) at the Bridgewater Hall next week."
Student or Learner