While Johnmof's assesment is fairly accurate, the early stages of the engagement on July 1, 1863, ended with the Union troops in full retreat through the streets of the hamlet of Gettysburg and ended when daylight failed with the beleagured Union now commanding Cemetery Ridge just south of town. Unique in the history of the War of Rebellion was the fact that the southern army approached from the north, while the northern army approached, initially, from the south. The defining moment of the battle occurred on July 3, however, with the massive, failed charge across a mile of exposed ground into the center of the Union line by General George E. Pickett... two brass markers just inside of the Union lines sums up the end of the charge.... one reads "Double Canister at 20 Yards (near a cannon battery, while the other, just a few feet away reads "High Water Mark of the Confederacy". Although the War continued for almost another 2 years, it was, as Johnmof states, downhill for Lee following this disaster...
I've walked the distance from the onset of the charge to it's end... it's truly a humbling experience...