Reading Chernow's Grant at the moment inspired this question, but I would be just as interested in hearing about other universities in pre-Civil War America, too.
EDIT: I appear to have gotten confused. George Washington Custis Lee, Robert's son, graduated first in his class at West Point in 1854. I was still interested in knowing more despite the fact that Robert finished a pathetic second in his class of 1829. As usual, AH provides superior answers to an inferior question, thanks!
In point of fact, Robert E. Lee graduated second in his class at West Point. The top of the class belonged to Charles Mason, who resigned from the Army after a year and did nothing of note.
Lee was one of the five cadets of his class who graduated without receiving any demerits. Overall ranking was determined according to the grand total of merit points available during the cadet's career at West Point; a total of 2000 were available, with points coming from the subjects taught there. They included, with Lee's scores,
Mathematics (maximum 300) 286
French (maximum 100) 98½
Natural Philosophy (maximum 300) 295
Drawing (maximum 100) 97
Engineering (maximum 300) 292
Chemistry and Mineralogy (maximum 100) 99
Geography, Rhetoric and Moral Philosophy (maximum 200) 199
Tactics (maximum 200) 200
Artillery (maximum 100) 100
Conduct (maximum 300) 300
His grand total was 1966.5/2000.
Douglas Southall Freeman's four volume biography of Robert E. Lee is very old and not always objective, but it's said the man knew where Lee was every day of his life; regardless of its flaws, its still a very valuable resource for questions like this, and you can find the complete thing for free here