Coupling of defects in one-dimensional (1D) and two-dimensional (2D) photonic crystals (PC's) is analyzed theoretically and investigated numerically using the transfer-matrix method and the finite-difference time-domain technique. Basically, the coupling behavior of defects is reflected in the spectra of PC molecules formed by two identical PC atoms (single defects). In both 1D and 2D cases, PC atoms can be roughly classified into two types based on the spectral shape of the resulting PC molecules. One type of PC atom generates clear bonding and antibonding states in the spectra of PC molecules. In contrast, the other type of PC atom creates PC molecules whose spectra are nearly flat on top. It is shown that this kind of PC atom is crucial for the construction of coupled cavity waveguides with quasiflat impurity bands. More accurately, we use a quantity related to the valley depth in the spectra of PC molecules to describe the coupling behavior of PC atoms. The dependence of this quantity on the properties of individual PC atoms is investigated in detail. It is revealed that the coupling of PC atoms is governed by the linewidth (\ensuremath{\delta}\ensuremath{\omega}) and the frequency shift of the PC atoms (\ensuremath{\Delta}\ensuremath{\omega}) upon increasing the confinement. The factor $(\ensuremath{\Delta}\ensuremath{\omega}/\ensuremath{\delta}\ensuremath{\omega}{)}^{2}$ is confirmed by theoretical analysis and numerical calculation to be a universal criterion to characterize the coupling behavior of both 1D and 2D PC defects.