Gaining an ability to work with your peers is one of the biggest potential benefits of attending high school. In many (or most, really) work situations, there will be some degree of coopertation necessary for success.
At times it is good to talk in class. When a teacher asks a question and opens it for discussion, the more people who are willing to talk, the better the discussion will go. If you are willing to do a lot of the talking, you are more likely to learn. It is also good to talk to classmates when the teacher has activities that require it.
There are times when it's inappropriate to talk. You teacher might seem like a stickler if he or she gets upset about little side conversations and chit-chat, but you would be surprised about how difficult it is to teach a lesson when people are talking about something other than the lesson at hand. Besides, you might miss something important. Believe it or not, your teacher doesn't talk because he/she likes the sound of it. We put a lot of time and effort into planning effective lessons for students, so we feel that that effort is wasted if people are talking and not paying attention to what we have to say.
I think a better way to look at your question would be the appropriate times to speak in class. If you are having concerns, speak with your teacher. I would support the idea that if the teacher is speaking, students should be listening. Sometimes though, talking with classmates is required (discussion or group work).
There is no one correct answer to your question, because different situations and activities demand different kinds of conduct. If your teacher is presenting new information or if some other kind of formal presentation is underway, no - you should be giving full attention to that speaker or program. On the other hand, if your class is involved in group work to solve problems or practice applications of procedures, talking with each other is essential!
It is good to become aware of different expectations that will rely on the appropriate response to whatever is being done.
I think that students learn more when they talk. The talking has to be productive. Talking about just anything will not do. It is important for us to talk, and listen, in order to fully work out our understanding of the concepts.
If the talk is about the work and the concepts and ideas surrounding it, then I would say it is very good to talk! I too have a rule that if someone is addressing the class, everyone should stop and listen. However, I expect that there is a low 'working noise' whereby students are clarifying ideas with each other as they respond to texts (unless in a test situation, of course).
I teach in New Zealand and the Maori culture is an oral one. It is often best to verbalize ideas to refine them before committing them to paper.
However, social chit-chat is unhelpful and distracting for everyone.
If your question is about "chit-chat" as Post 2 is talking about, then you definitely should not talk in class. It is rude to the teacher and it is rude to other students. If you are talking about the lesson, it's not so bad. However, if you have a question or comment I'd really rather hear it myself so that it can potentially help the whole class to understand something important.
As a longtime teacher, my foremost classroom rule is "no talking if the teacher is talking." Class time is for learning, not socializing. Gossip and chit-chat in class between students is distracting to both the teacher and other students, and it is detrimental to the educational process. There is plenty of time for socializing outside of class--during breaks and lunch, for example. School is not a democracy, and students do not have the inalienable right to speak whenever they wish during class time. Needless to say, some classes allow for plenty of student interaction, and I usually give students great leeway for expressing their opinions; but if the talk is between friends over subjects not pertaining to the lesson at hand, it becomes counterproductive to education.