Born in Windsor, Connecticut, Niles received a common school education and studied law.
Appointed United States Postmaster General by President Martin Van Buren in 1840, Niles served until the end of the administration in 1841.
When he was a US Senator, in 1845, he cast the deciding vote admitting Texas to the Union as a slave state, though he was against slavery.
[4] Associating with the Free Soil Party campaign of his friend Van Buren in 1848, he became their candidate for governor in 1849.
He had no children and bequeathed his library to the Connecticut Historical Society and left $70,000 in trust to the city of Hartford as a charity fund, the income of which he directed to be annually distributed to the poor.