For all practical purposes the US Civil War ended when General Robert E. Lee surrendered his army to General US Grant at the Appomattox Court House on April 9, 1865. Other Confederate troops soon after also surrendered. The last Confederate ship lowered its flag near Liverpool, England late in 1865.
For all practical purposes the US Civil War ended when the Confederate general in chief, General Robert E. Lee surrendered to his counterpart for the Union, General US Grant on April 9, 1865. This ceremony was held at the Appomattox Courthouse in Virginia. Yes it took time for other Confederate armies to surrender as word spread that Lee had surrendered. As an aside, the last Confederate flag was lowered on a Confederate ship docked in England in December of 1865. It seems almost to the day that the war began and ended in early April, 1861 and 1865. The healing would take decades.