What is realistically the latest period that slavery could have survived in the U.S.? There are a few potential POD's to consider:
For one, what if the fewer compromises are made in the decades leading up to the OTL civil war and slavery has an easier expansion into the territories?
It really depends on how far back you want your POD. If slavery can be successfully retained
de facto in some northern states (as opposed to being grandfathered or simply ignored), then there isn't much incentive to compromise on the slavery issue. You might get an earlier civil war where some northern states and territories choose to leave rather than what we saw in OTL.
Second, what if Lincoln loses in 1860? Does that merely delay the war or was it always inevitable?
War was inevitable when the Democrats split their convention on the issue of slavery for the 1860 election. I do not believe the war itself was inevitable before then if cooler heads prevailed. If you avoid annexing Texas and thus the Mexican War, then you may or may not have had a war.
What if the south is allowed to secede? How long does slavery survive in an independent CSA?
This depends. Without external pressure and all things occurring in a vacuum, indefinitely. But nothing really occurs in a vacuum. Without a war, Arkansas, Tennessee, North Carolina, and Virginia would remain in the Union. The slave power itself would be significantly weakened in the USA. The CSA would also be in a much worse position both militarily and economically. Keep in mind that a "maximum CSA" with Missouri, Kentucky, and Maryland (Delaware is a pipe dream) would have made the CSA much stronger than it was in OTL. A "maximum CSA" could have resisted external influences much better than a "minimum CSA" we see in a TL where the South was allowed to leave peacefully. We really don't know what could happen here.
There are many other potential POD's and sets of circumstances here, but which one produces the latest time frame for the end of slavery in America - be it the USA or CSA - and what is that time frame?
The CSA leaving peacefully will lead to a quicker end to slavery in the USA. The loss of seven slave states SEVERELY cripples the slave power in the USA. The remaining slave states in the USA would be at the mercy of time itself and they would not be able to stop an amendment to the Constitution that would abolish slavery. Of course, that could touch off some defections to the CSA if that were to happen. If the USA permitted the secession of the CSA, the Federal government would be powerless to stop future secessions without a Constitutional amendment.
As far as the CSA goes? Anyone's guess.