Not very long at all. Borders create national identities, and as we've seen from OTL the Confederacy created a separate semi-national identity despite never actually achieving full independence (where full independence is defined as "not in a massive war").
What helps here I think is that the South saw itself as the true heir to the "first" American Revolution, and thus saw the North as not being a representative of the ideal of America.
The idea that "borders created national identities" meshes poorly with history. For example, the history of Africa from the Scramble for colonies of the present. A lot of the borders were drawn in Europe, leaving people groups divided between different countries and/or sharing countries with rival or hostile people groups. The Rwanda genocide is a more extreme example of borders failing to create national identities.
For the Confederacy, there were men like Jefferson Davis and Robert E Lee who believed their chief loyalty should be to the central Confederate government; while others, such as the Confederate Vice President Alexander Stephens, or the Governors of Georgia and North Carolina took more of a States Rights position. Additionally, the South was not a monoculture - most people who attended a cotillion would not be caught dead at a hoedown, and vice versa. The Tidewater of Virginia & North Carolina, the Appalachians, the Deep South, Louisiana, and Texas had differences in culture and political interests. Playing up the Union as a boogeyman would probably hold the Confederacy together, but it is not certain. Then there's the slaves, roughly 40% of the Confederate population. The Confederacy is not their nation as many of them showed during the Civil War.
Both sides of the Civil War saw themselves as the true heir to the American Revolution, but many Confederates also saw that Revolution as flawed.
"The prevailing ideas entertained by...most of the leading statesmen at the time of the formation of the old constitution, were that the enslavement of the African was in violation of the laws of nature; that it was wrong in principle, socially, morally, and politically. It was an evil they knew not well how to deal with, but the general opinion of the men of that day was that, somehow or other in the order of Providence, the institution would be evanescent and pass away. This idea, though not incorporated in the constitution, was the prevailing idea at that time. The constitution, it is true, secured every essential guarantee to the institution while it should last, and hence no argument can be justly urged against the constitutional guarantees thus secured, because of the common sentiment of the day. Those ideas, however, were fundamentally wrong. They rested upon the assumption of the equality of races. This was an error. It was a sandy foundation, and the government built upon it fell when the “storm came and the wind blew.” Our new government is founded upon exactly the opposite idea; its foundations are laid, its corner- stone rests, upon the great truth that the negro is not equal to the white man; that slavery subordination to the superior race is his natural and normal condition. This, our new government, is the first, in the history of the world, based upon this great physical, philosophical, and moral truth." -
Alexander Stephens