William E. Lehman was born in Philadelphia, Pennsylvania. He pursued preparatory studies, and graduated from the University of Pennsylvania at Philadelphia in 1841. He studied law, was admitted to the bar in 1844 and commenced practice in Philadelphia. He was appointed post office examiner for Pennsylvania and New York by President James K. Polk.
Lehman was elected as a Democrat to the Thirty-seventh Congress. He was an unsuccessful candidate for renomination in 1862. During the American Civil War, Lehman was the United States provost marshal of the first district of Pennsylvania with the rank of captain from April 25, 1863, to June 15, 1865. Having an ample income, he did not engage in any business or professional activities and died in Atlantic City, New Jersey, in 1895. Interment in St. Peter's Episcopal Church Cemetery in Philadelphia.