It's okay though, because I didn't learn anything from that experience. ;D In my second year of engineering, I took a cognitive science class, and asked a ton of questions. At the end of the course, the professor recommended me for a fourth-year research course in a cogsci lab!
In an academic environment, for example, there can be prerequisite knowledge for particular courses, and within a course, you are expected to form a foundation of knowledge upon which later material is based. Questions that betray lack of prerequisite or foundational knowledge rather than topical are often considered unhelpful.
More generally, there is the matter of social context, and the relevance of your question to the people who will be listening to its answer. People value their time, and dislike spending it in a Q&A they consider to be without any value, either informative, personal or entertaining. If you can be pretty sure a question is only relevant to you, it's more appropriate to ask in private than in front of a large audience.
Beyond that, I wouldn't worry about it.
In my experience, the only time questions were discouraged (and almost always in the interest of time) was because it was otherwise possible to get an answer to your questions.
Can you give an example of the environment you would be talking about?
But to echo the other reply, get out, life's too short to bother with that.
A lot of high school teachers know little past what they are actually teaching and even that not in a lot of depth. This is for a lot of reasons, some of them not their fault, but it is a sad fact.
So, keep asking and keep annoying them. Try going and asking during their office hours, but don't be surprised if you do not get a satisfactory answer and if it does not seem satisfactory, I would question its validity.
Keep in mind though. High school teachers are mostly overworked. Even the ones that know what they are talking about (some don't - we established that already), so do cut them some slack and be curteous. But keep asking questions. And if they don't answer, ask anyone who will. Read, explore and keep learning. It's what keeps us alive and what - at least according to this post - keeps us smart.
Good luck and you are on the right track to greatness.
Interesting choice of words. Office hours are the "teaching environment". The classroom is the (increasingly obsolete) bulk information transfer environment.