Heiles was born in Toledo, Ohio. He did his undergraduate work at Cornell University, receiving a degree in engineering physics, and then received his doctorate under George B. Field in 1966 from Princeton University in astrophysical sciences. He has worked at the University of California, Berkeley since, and is currently a professor of astronomy.
While Heiles was still a graduate student at Princeton, he wrote a paper with Michel Hénon about a third integral of motion in axisymmetric potentials, from which the Hénon-Heiles equation is drawn. Though his paper with Hénon has been cited more than all but one of his other papers, most of Heiles's work has been in the field of radio astronomy. Heiles was part of the team which discovered the first millisecond pulsar, PSR B1937+21. Heiles has also been pivotal in understanding the diffuse gas in the interstellar medium, primarily through observation of the hydrogen line. His role in this field is such that a conference at Arecibo Observatory in Puerto Rico on diffuse matter was held in honor of Heiles's 65th birthday. Observations of this gas has helped develop a better understanding of star formation and galactic gravitational and magnetic fields.