so why textbook often say that mgh is potential energy only belongs to
object ?
Unfortunately you will more often than not hear it said that an object has potential energy. But it is technically incorrect. Potential energy of any form (e.g., gravitational, electrical, elastic) is a system property related to the positional relationship of objects, not a property of single object.
For example, what would be the gravitational potential energy (GPE) in your example if the earth (and all other gravitational bodies potentially exerting a force on the object) were to suddenly disappear? GPE only has meaning for a system of two or more gravitating bodies, not a single body.
On the other hand, consider at some instant during the fall when the object has a velocity of $v$ and therefore KE of $\frac{1}{2}mv^2$, as measured by some observer in space. If the earth were to suddenly disappear what would its velocity and KE be? It will continue to move with constant velocity $v$ with KE of $\frac{1}{2}mv^2$.
- If potential energy mgh only belongs to object, so its energy is E = PE + KE + U according to the law of conservation of energy, we have: ΔE = ΔPE + ΔKE + ΔU = Wg + Q but Wg = 2102 = 40(J) and Q = 0
(because there is no friction between air and object) and ΔPE + ΔKE =
0 so ΔU = 40(J), so its internal energy changed (?)
In order to talk about gravitational potential energy we need to define the system as the combination of the earth and the falling object, i.e., the earth-object system. We will also need to consider the system for two cases: 1. While the object is falling (prior to impact with the earth) and 2. After coming to a stop due to impact with the earth.
Case 1: While object is falling
If we can consider the earth-object system to be an isolated system (meaning we need to ignore the gravitational effects, electromagnetic radiation, etc. associated with interactions with other celestial bodies) then the change in total energy of the earth-object system is zero, or $\Delta E=0$. Then,
$$\Delta KE +\Delta PE +\Delta U=0$$
It is important to understand the difference between a change in internal energy, $\Delta U$ and mechanical energy, $\Delta KE$ and $\Delta PE$ . Internal energy is the kinetic and potential energy of the motions of, and forces between, the atoms and molecules of the system (of our object and the earth). The mechanical KE and PE is that of the motion of the object as a whole and its position as a whole with respect to the earth.
For example, if there were air resistance, the friction between the air and object would result in an increase in the temperature of the object (increase in the KE of its molecules). That increases the internal energy of the object at the expense of a loss the kinetic energy of the object as a whole, for conservation of energy.
Since your example does not involve frictional forced while the object is falling, and the earth-object system is assumed to be isolated we have both $\Delta E=0$ and $\Delta U=0$, and we are left with conservation of mechanical energy, or
$$\Delta KE+\Delta PE=0$$
Case 2: Object impacts earth
Let's assume that when the object impacts the earth it comes to a stop imbedded in the earth. All of its mechanical energy KE just prior to impact is mow lost in the inelastic collision. The work done by the earth in stopping the object is internal to the earth object system. The impact results in an increase in the internal energy (molecular KE and PE) of the earth-object system. The earth object system is still isolated ($\Delta E=0$) and the result of the impact is
$$\Delta U=+40 J$$
Conclusion:
So you are correct that $\Delta U=+40 J$, but it is only correct following the impact when the object comes to a stop (case 2). In effect, the loss of gravitational potential energy the earth-object system had before the fall equals the increase in internal energy of the earth-object system at the conclusion of the fall.
However, before the impact (case 1) $\Delta U=0$ and $\Delta PE+\Delta KE$=0.
Hope this helps.