When the Civil War ended and the 13th Amendment was adopted (both in 1865) slavery became illegal. However, this does not mean that blacks gained civil rights at that time.
The first part of Reconstruction was conducted under the plan of Pres. Andrew Johnson. Johnson was not strongly pro-black and did not do much to try to guard the rights of blacks. Instead, he allowed state governments to do things like instituting the "black codes." These laws set strict limits on the rights of black people.
It was not until 1866 that there were even laws on the books guaranteeing blacks their civil rights. In that year, Congress passed the Civil Rights Act as well as the 14th Amendment. These were supposed to ensure that blacks would have all the same rights as whites. But even these laws had little force until Radical Reconstruction started in 1867.
So it was not until 1867 that blacks in the South had civil rights. Of course, they did not keep those rights for long. Once Reconstruction ended in 1877, they essentially lost all their rights until the middle of the 20th century.