The above article has some details for each president, including how they made most of their money. Most inherited their money, but not all. Some of this wealth is actually the wealth of the president after leaving office. Many modern day presidents such as Bill Clinton, Barack Obama and Gerald Ford only made their millions after leaving office (from book deals).
Republican presidents have a total of $3,847 million dollars net worth while Democratic presidents have a total of $1,467 million dollars net worth (in 2016 dollars).