Johns Hopkins made his great fortune by investing his money wisely in all sorts of ventures, most notably the Baltimore and Ohio Railroad, of which he became a Director in 1847 and Chairman of the Finance Committee in 1855. He was also President of Merchants' Bank and director of many others. In 1867, he gave consideration to the disposition of his tremendous wealth and, on August 24, he incorporated The Johns Hopkins University and The Johns Hopkins Hospital. After his death on December 24, 1873, his will was probated, and his fortune of seven million dollars was divided equally between the two institutions that bear his name.
If you are interested in reading more about Johns Hopkins, there is only one biography, by his cousin, Helen Hopkins Thom, Johns Hopkins: A Silhouette (Baltimore: The Johns Hopkins Press, 1929).
http://www.library.jhu.edu/collections/specialcollections/archives/johnsbio.html