We calculate the thermal equilibrium gas temperature of the diffuse interstellar medium. Our method incorporates a new photoelectric heating rate from small grains and PAHs that accounts for a size distribution of particles extending from 100 to 3 Angstrom in radius. We also include a detailed treatment of the ionization rates and heating due to the soft X-ray background and due to cosmic rays. Phase diagrams (thermal pressure P versus hydrogen density n) are presented for gas that is illuminated by the local interstellar far-ultraviolet (FUV) and X-ray radiation fields. A stable two-phase medium is produced with thermal pressure in the range P/k similar or equal to 10(3)-10(4) K cm(-3). We demonstrate that photoelectric heating from PAHs dominates in the warm neutral phase (WNM) and cold neutral phase (CNM). The WNM is cooled by Ly alpha C II (158 mu m), O I (63 mu m), and electron recombinations onto positively charged grains. The CNM is cooled primarily by C II (158 mu m). The C II (158 mu m) cooling per hydrogen nucleus ranges from 2.6 to 6.6 x 10(-26) ergs s(-1) H-1 in the CNM and 0.31 to 0.81 x 10(-26) ergs s(-1) H-1 in the WNM, which compares favorably to recent observations. If the C II (158 mu m) cooling per hydrogen nucleus in the solar neighborhood represents an average value for the Galaxy, we predict L(C II) similar or equal to 7 x 10(7) L. from the CNM in the Galaxy, comparable to that observed by COBE. We discuss the dependence of the results on absorbing column density (10(18) cm(-2) < N-W < 10(20) cm(-2)), gas-phase abundances (variations in C and O of similar to 2), dust abundances and metallicity (from 0.003 to 3 times solar), FUV field (0.3-1000 times local values), and the X-ray radiation field (two models of background X-ray fluxes). These results will be useful in modeling the multiphase structure of high-velocity clouds in the halo, the ISM at other galactocentric radii, and the ISM in external galaxies and galactic nuclei.