In 1852, Slocum graduated from the U.S. Military Academy, seventh in his class of 42. He remained in the military for just four years, serving in Florida and South Carolina. In 1856, he left the service to study law, and by 1858 he had established a practice in Syracuse, New York.
After serving in the New York State assembly, Slocum became a lieutenant colonel in the New York State militia. When war broke out, he received command of the 27th New York Infantry and was commissioned colonel. Slocum fought at the First Battle of Bull Run, Virginia, in July 1861. Although he was wounded and his regiment suffered 130 casualties out of about 800 present, his star rose rapidly in the Army of the Potomac. He was promoted to brigadier general after Bull Run, and by the time the army embarked on the Peninsular campaign in Virginia in May 1862, he was a major general. In October 1862, Slocum received command of the army's XII Corps.
In July 1863, Slocum participated in the Battle of Gettysburg, Pennsylvania. That fall, his corps was placed under the command of General Joseph Hooker in order to reinforce Union troops in Chattanooga, Tennessee, after the Battle of Chickamauga in Georgia. Slocum disliked Hooker, who had suffered a major defeat at the Battle of Chancellorsville, Virginia, in May 1863. Rather than serve under Hooker, Slocum resigned. However, his resignation was not accepted, and he was sent to command forces at Vicksburg, Mississippi.
Slocum was selected to command one wing of the Federal army during General William T. Sherman's famous "March to the Sea" in late 1864. He remained with Sherman as the Yankees pacified the Carolinas, and was present at the surrender of Confederate General Joseph Johnston's army at the end of the war.
Slocum resigned his commission in 1865 and returned to New York. He practiced law in New York City and served in the U.S. House of Representatives from 1868 to 1873 and again from 1883 to 1885. He died in Brooklyn, New York, in 1894.