If the solute releases energy when it dissolves, then the solution will heat up. If it takes energy to make the solute dissolve, then the solvent molecules will "steal" thermal energy from the solvent, and the temperature of the overall solution will decrease. This is why it's endothermic.