As noted by Tyler Durden, you need to differentiate between concentration camps and extermination camps. So far as the former were concerned, they were not only well known but needed to be well known. Prisons can hardly serve as effective deterrents if their existence is kept a secret! According to Robert Gellately, the Gestapo never had more than about 32,000 employees. Since there were approximately 60,000,000 people in Germany alone, they were only ever going to be effective if people knew precisely what would happen were they to be arrested.
Such was not the case when it came to extermination camps, the existence of which needed to be kept secret for more than one reason. For a start, it was imperative that victims not know where they were going and what was going to happen to them when they got there. The SS went to great lengths to preserve the mystery around these places, telling people to bring luggage with them, changes of clothes, cutlery and a small amount of money - and even, in the case of Jews from Iannina in Greece, purchasing tickets.
Secondly, the Nazis also wanted to ensure that the outside world would know as little as possible about the purpose of these installations. Battling against the Russians on the Eastern Front, the last thing they wanted their enemies to know was that being captured would involve being subsequently murdered. To win this war, the Nazis needed the Russians to surrender. When word got out about the wholesale murder to Soviet POWs (some 2,000,000 - approximately), the Russians knew that it was in their best interests to die fighting.
Finally - and most germane to your question - the Nazis did not want their general population to know. With all that was going on (rationing, power shortages, allied bombing), they counted desperately on the continued support of their own population. It is one thing for people to look the other way when they see people being persecuted, even violently; it is quite another to know that entire communities of people are being murdered through an impersonal, industrial process.
That said, while guards were under strict orders not to speak about what they saw and what they did, people always speak about what they see and what they do. When given time away from work (which was every so often), people not only spoke about what they had seen, they did so in great detail. Some guards had personal photo albums that related to the times they had spent in individual facilities - and, of course, the same thing goes for shooters. (Most of the so-called "Einsatzgruppen" photos were taken by perpetrators, and many were sent home to their families by post).
I don't personally know of any instances of people being punished for revealing information to their families and friends, although that may have happened. They certainly weren't supposed to.