One of the essential features of therapy is the notion of confidentiality. What you say to your therapist is held in the strictest of confidence. This is designed to assist the client to feel free to share their deepest thoughts, fears and feelings. It is a crucial part of the process. Even the nature of the relationship is considered confidential so that if you were to run into your therapist in the supermarket they could not introduce you as their client without your expressed permission.
There are exceptions to these rules, and before entering onto a therapeutic relationship a client should be very clear about what those exceptions are Each State in the U.S. has its own governing body that oversees the profession of therapy and even within the profession there are divisions between Psychiatrists, Psychologists, MFTs (Marriage and Family Therapists) and Social workers. Many of the laws cross over between these professions and in California all are considered mandated reporters. What this means is that there are a handful of things that if you tell your therapist they will be required to "report" the information to a specified source.
Since I am licensed in the State of California I can only speak about those laws but, as I have mentioned, many of them are the same throughout the country. I am unaware of the laws that pertain to countries outside the U.S. but I would imagine many countries have similar guidelines. In California if you tell your practitioner that you have hurt a child or an elder, they are required to report that abuse. If you disclose to your therapist that you have committed an act of child abuse in the past, even if that child is now an adult, your therapist must report the incident if you are currently around minors. In addition, we are required to report if someone is a danger to themselves by being gravely disabled, or to others, or if they make clear threats of harm towards a specific individual.
The laws are subject to interpretation but it is incumbent upon a therapist, to the best of their ability, to ensure the safety of their client and those persons with whom their client comes in contact. This is by no means a comprehensive list of possible scenarios that would require a therapist to break confidentiality but it is a basic guideline. I advise that prior to initiating any therapeutic relationship a client should be aware of the laws that govern their practitioner.