pretend as mrsnewfie says, teachers by themselves don´t have much power to punish students. You can tell them to stop, warn them, move them to sit in a different seat, send them outside to the corridor (you can only send one student out, though, so not a solution if more than one is misbehaving) and you can give up your own time, if you don´t have a meeting, duty or lunchtime lesson, to give them a detention. You can also e-mail or call their parents.
But some students are happy to be sent out every single lesson and don´t mind coming to detentions, especially when it´s freezing cold outside, or just don´t turn up to detention. And often parents aren´t really that bothered that their children are chatting - they´d be much more shocked if their child, for example, swore at a teacher, kicked a chair across the room, or something like that, for which the school would punish them much more harshly but actually has much less effect on their overall learning than repeatedly messing around and failing to pay attention during many, many lessons, which also impacts negatively on other students´ learning, where a one-off, more serious "incident" would not (or not to such an extent).
What needs to happen, and unfortunately doesn´t happen in a considerable number of schools, is that repeated low level disruption such as chatting, results in a much tougher punishment from a more senior member of pastoral staff, such as an after school detention, Saturday detention, internal exclusion, parent meeting. Therefore, the message sent to the students is that frequent low level disruption is ok, and results only in a minor sanction.