You can add thermal energy and the temperature won't change. This can happen when you've added less than the specific heat of the substance or if the substance in going through a phase change when the temperature is constant but the energy is changing the phase (the spacing of the particles)