That’s a difficult question. Thanks to the slow communications of that era, the Battle of New Orleans was fought after the War of 1812’s peace treaty had been signed. The Korean War fighting stopped with an armistice agreement, but no peace treaty has been signed yet. Individual soldiers of the Japanese Imperial Army continued hiding in the jungle for decades after the surrender ceremony on the U.S.S. Missouri.
The Civil War is a good example. Many sources erroneously give Lee’s surrender at Appomattox as the end of the war, but that was just the Army of Northern Virginia. For the full story, see https://www.history.com/news/why-the-civil-war-actually-ended-16-months-after-lee-surrendered.