The terms endothermic and exothermic stem from the relative values of enthalpy, which is the sum of the PE and KE.
A + B ----> AB + heat
In this reaction (exothermic) PE is being turned to KE and released as heat, therefore, during this reaction, PE is lost and KE is gained.
C + D + heat ----> CD
This reaction is endothermic; heat is being added to the system and is being stored as PE. Therefore, PE is gained.