While there were still hostile forces throughout the South and even battles after the surrender at Appomattox Court House (and after Johnston's surrender at Bennett Place), and the last surrender didn't occur until November of 1865, Appomattox Court House is considered the end of the Civil War because it marked the end of real resistance to the Union. Before surrendering, Lee had been trying to escape into North Carolina to join forces with Johnston, hopefully smash Sherman's army, then turn and smash the Army of the Potomac. There was no realistic chance of things turning out like that had Lee escaped, but still, Lee was actively resisting and planning to engage the enemy in battle when he saw an opportunity. He surrendered because his escape route was cut off in every direction except to the northwest.
After Lee's surrender the rest of the South generally accepted that further resistance would be futile, and while Jefferson Davis wanted the armies to break up into guerrilla bands rather than surrender, Johnston knew that all he could really do was get better terms for his men, and walking away from the negotiating table and taking up active campaigning was not an option. We know this because Sherman originally offered him very generous terms in a misguided attempt to wrap up both the war and reconstruction at the same time, and when Grant showed up to tell him that Stanton had blown his top over this, Sherman came back with merely the same terms Grant had given Lee at Appomattox Court House, Johnston accepted them. He knew he had no leverage anymore.