A dual-narrowband absorber in the terahertz (THz) band is proposed and numerically analyzed, which consists of a sheet of graphene on a photonic crystal (PC) heterostructure. We find a huge enhancement of absorption because optical Tamm states (OTSs) are excited at the interfaces of graphene-PC and PC heterostructure. The full width at half maximum (FWHM) of the absorption peak near the wavelength of 300 μm can be as narrow as 1.25 μm, and narrower FWHM can be obtained by adapting the wavelength and incident angle of the light beam. The wavelengths of absorption peaks and the absorptivities can be tuned by controlling the Fermi energy of graphene and the periods of PCs. In addition, the absorber can maintain high absorptivity over a wide incident angle range for both TE and TM polarization. The proposed optical absorber has potential applications in THz biosensors, filters, and switches.