Well, depending on what you mean by "truly set free," this could get sticky in terms of an answer. For example, one could convincingly argue that until the Civil Rights movement crested in the mid-to-late 1960s, African Americans in the deep south were only just slightly removed from the institution of slavery. While it is true that 100 years later, these African American citizens weren't technically "owned" in the conventional slave sense, their career prospects, civil rights, and overall safety weren't all that much improved than what they experienced a century before. Now, don't get me wrong: I'm not flirting with hyperbole. There is a clear and obvious difference between the disgusting institution of slavery and the shameful history of Jim Crow America, yet it is important to understand that the African American struggle for personal liberty didn't end in 1865.
Now, to answer your question a bit more directly, at least as I understand it, slaves in the "deep south" (so I'll take this to mean Confederacy states not on the Mason Dixon line) were more or less free from May 1865 onward. At the time of Lee's surrender in April '65, most of the infrastructure for keeping slaves on-site had evaporated. The home guards had largely been depleted by the necessities of the war's later stages, just as the overseers had largely moved off either because of impressment, or because they weren't getting paid. With few people around to chase after the escaped slaves, many of the African Americans in bondage took off and headed north when the opportunity presented itself. Those few still working on May 9, 1865 (when the war was declared officially over) were in some cases offered a wage to stay on and work for their former masters, but many headed north.
You have to understand that in many cities, Union occupation forces were still nearby, and local civic governments were headed up by pro-Union figureheads that were put in place to get that region or municipality on the same page as the federal and (new) state governments. For a "master" to try and just ignore the Civil War and keep his/her slaves would have been nearly impossible.
This doesn't mean that everything was paechy for the former slaves, be it north or south. Aggressive legislation that the Radical Republicans pursued in the newly conquered south led to a lot of friction between the southerners, their Union-appointed leaders, and the former slaves that were trying to make an honest life for themselves. In the north, things weren't all that much better for the former slaves. A lot of northerners were resentful of the large influx of former slaves pouring into cities like Chicago, Detroit, etc., which made housing and employment challenging to say the least.
TD;LR - The slaves were free pretty much right away, from May 1865 onward, yet this didn't necessarily mean that they were afforded anything resembling fair and just treatment.
[Sources - Jay Winik, 'April, 1865'; Bruce Catton, 'A Stillness At Appomattox"; James McPherson, 'Battle Cry of Freedom']