The purpose of the program was intially to destroy the CPUSA? using counterintelligence? techniques in the 1950s. However it expanded to also attack the Socialist Worker's Party, the "New Left" (including several anti war groups such as the SDS?), African American groups such as the [Black Panthers]?, the [Southern Christian Leadership Conference]?, and even the KKK and the [American Nazi Party]?.
The entire program was secret until 1971, when an FBI office was burglarized and many secret documents were stolen. The crime was never solved, and the group responsible slowly leaked the documents to various members of the media and congress. Within the year, Hoover shut down COINTELPRO for good. The media and congress got curious. Eventually in 1977, the government decided to release virtually all the previously secret COINTELPRO documents.
Reference: Assault on the Left. James Kirkpatrick Davis. 1997. Chapters 1 & 8