But, popular myth notwithstanding, the surrender of the Army of NoVa did NOT mark the end of the war.
Stand Watie and his 1st Cherokee Mounted Rifles did not stand down until 23 June, 1865.
The State of Texas stood in rebellion until it constituted a new, "Union-friendly" government in August of '65, inaugurating a Unionist as Governor on the 9th. And on the 20th, POTUS Andrew Johnson remarked, "...[S]aid insurrection is at an end and that peace, order, tranquility, and civil authority now exist in and throughout the whole United States of America...."
And Confederate States Navy Lieutenant Commander James Waddell did not relinquish his command of the Confederate States Ship Shenandoah until 6 November of '65.
So where you stick a pin in it is arguable but by no means did the war end when Lee surrendered.
never claimed that it did.