As ruled in United States v. Anderson
76 US [9 Wall] 56. The official end of the Civil was was ruled as 20 August, 1866:
The Court of Claims assumed jurisdiction of cases under the Abandoned Property Act, and between the termination of actual hostilities and the date fixed by the court below as the legal suppression of the rebellion (20 August, 1866), thirty causes were commenced in that court under the act and jurisdiction of them entertained. In this Court, the causes pending at the beginning of the war to which inhabitants of the states in rebellion were parties and which had been suspended and postponed from term to term during the continuance of the war were, at the December Term 1865, by the order of the Court, called and heard in their order on the calendar or on special days to which they were assigned. Post Offices were reopened, the letting of contracts for mail service throughout the rebellious states resumed, and the revenue system extended throughout the same states. The federal courts, too, were reopened in the insurrectionary districts. But notwithstanding all this, the late rebellious states were to increase the pay of soldiers in the army should be 'continued in full force and effect for three years after
the close of the rebellion, as announced by the President of the United States by proclamation bearing date August 20, 1866.' " [76 US 56, 58-60]
Full case study:
https://studycivilwar.wordpress.com/2016/03/15/united-states-v-anderson/