What are the two factors that determine an object's thermal energy?
An object's thermal energy is dependent upon its temperature and mass. The higher the temperature of a given quantity of a substance, more is its thermal energy. Similarly, for the same temperature, higher mass of a substance will contain more thermal energy. When we supply heat to a substance, its temperature rises and so is its thermal energy. Consequently, a substance loses its thermal energy and consequently its temperature. The only exception is the phase change, where the substance will change its phase (by absorbing heat), without a change in its temperature. To demonstrate the effect of mass on thermal energy, try heating two different quantities of water and measure their temperature. The container with a higher quantity will need higher heat input for the same temperature rise and hence has higher thermal energy.
Hope this helps.