On May 29, 1865, President Andrew Johnson issued a Proclamation of Amnesty and Pardon to persons who had participated in the rebellion against the United States. There were fourteen excepted classes, though, and members of those classes had to make special application to the President.
Lee sent an application to Grant and wrote to President Johnson on June 13, 1865:
Being excluded from the provisions of amnesty & pardon contained in the proclamation of the 29th Ulto; I hereby apply for the benefits, & full restoration of all rights & privileges extended to those included in its terms. I graduated at the Mil. Academy at West Point in June 1829. Resigned from the U.S. Army April '61. Was a General in the Confederate Army, & included in the surrender of the Army of N. Va. 9 April '65.