The "openness" or lack thereof of meetings held by state and local governing bodies are regulated by laws enacted by the various state legislatures.
Open Meetings and Federal Agencies
At the federal level, about 50 independent regulatory agencies are subject to the Government in the Sunshine Act. The Act establishes the procedures an agency must follow to close all or parts of its meetings to the public. Agencies are allowed to close meetings to protect national security or to discuss other information that could potentially delay the proposed agency action. Agencies can also close meetings that involve pending or anticipated legal action involving the agency.
Open Meetings and the U.S. Congress
The authority for the U.S. Congress to hold closed or "secret" sessions comes from Article I, section 5, of the Constitution which says: "Each House shall keep a journal of its proceedings, and from time to time publish the same, excepting such parts as may in their judgment require secrecy..." While both the House and Senate have adopted their own rules regarding secret sessions, they are typically held to discuss business such as Senate deliberations during impeachment trials, issues of national security, and sensitive communications received from the President, all deemed to require confidentiality and secrecy.
Ironically, both the Continental Congress and the Constitutional Convention -- where our Constitution was written -- met in secret, and the U.S. Senate met only in closed sessions until 1794. Feeling that it was providing advice and consent directly to the president, the Senate continued to consider treaties and nominations only in secret sessions until 1929.
Since 1929, the Senate has met in secret 54 times, usually citing reasons of national security. On November 1, 2005, the Senate met behind closed doors to discuss potentially faulty intelligence leading up to the Iraq war. The Senate also met in six secret sessions during the impeachment trial of President Clinton.
The House of Representatives has met in secret only three time since 1830: in 1979 to discuss the Panama Canal, in 1980 to discuss Central American assistance, and in 1983 to discuss U.S. support for paramilitary operations in Nicaragua.
Any member of Congress can request a closed session, but several members will usually agree in advance to do so.
Transcripts or minutes of secret sessions of Congress are not published unless the relevant chamber votes to release all or portions of them. Released portions of secret meetings are printed in the Congressional Record. Records of secret sessions not released by the House are transferred to the National Archives and Records Administration and may be released to the public after 30 years. You can read a much more detailed discussion about closed sessions of Congress in Congressional Research Service Report RS20145 (.pdf), Secret Sessions of Congress: A Brief Historical Overview, by Mildred Amer.
[Partial source: Congressional Research Service]