Is this a counterexample to the change in internal energy always being zero? In class, I have learned that for isothermal processes the following is true at all times.
$$\Delta U=q+w=0\text{ J}$$
But suppose I lift an object against the force of gravity. Then I (the surroundings) have done work on the object (the system) without exchanging heat (neglecting friction).
Now, I claim that because some nonzero work has been done on the system, and no heat has been exchanged, the change in internal energy is nonzero:
$$\Delta U=w\neq0\text{ J}$$
Are my assumptions about internal energy incorrect or is there something totally wrong about my approach?
 A: It is most likely that you were specifically focusing on an ideal gas whose internal energy can purely be specified by its temperature. A key assumption of the ideal gas is that its particles do not interact through some sort of potential energy. In other words $U$ for the ideal gas doesn't take into account any sort of potential energy between the gas molecules
Leaving the ideal gas behind, in the case of your lifting an object, the object and the Earth are interacting and have a potential energy associated with this interaction. Therefore, $U$ will depend on the separation between your object and the Earth, and thus when you lift the object you are changing $U$ of the object-Earth system. 
Therefore, please do not "memorize" $\Delta U=0$ for any system whose temperature is not changing. It is true for ideal gases, but not true in general.
A: Since this is a duplicate thread to the one in the chemistry stack exchange, I am going to duplicate the answer I gave in that thread here:
The situation you cite calls for the use of the more general form of the first law of thermodynamics (which I assume your textbook provides), given by $$\Delta U+\Delta (KE)+\Delta (PE)=q+w$$where KE is the organized kinetic energy of the system and PE is the potential energy.  Applying this to the problem at hand gives $$\Delta (PE)=w$$and the change in internal energy is zero.  So the thing that was wrong with your approach was not using the proper form of the first law.
A: The expression $\Delta U = q - w$, where $\Delta U$ is a function of temperature doesn't include gravitational potential energy. 
It is similar to theory of elasticity. We can say that the work done tightening a bolt is converted in elastic energy of streching it. But if we raise a little bit its center of gravity while turning, part of the work is converted to gravitation potential energy.
I think that in both cases gravity is disregarded as a second order factor.
A: First of all, not every isothermal process has $\Delta U=0$. Only for systems whose internal energy depends only on temperature $T$ is this true.(see ideal vs van Der Waal's gasses)
Conversely, for a system undergoing any process for which $\Delta U=0$, $q+w=0$.
For a system displaced in an external field with all other parameters constant, all that can be said is $q=0$, so $\Delta U=w$, which while lifting a block, is just the potential energy change.
Does this $\Delta U$ manifest itself in thermodynamic considerations of the system? Would the object's temperature or pressure change? Not really.
You see there is a reason $U$ is called internal energy. In thermodynamics we ignore the energy contributions that do not lead to change in the internal state of the system. We do this by stipulating that the change from such processes can be bundled into the change in state of the center of mass, while the state variables may be measured wrt the COM.
So for e.g., if the field is gravitation and the process is a displacement we would say that there is no change in the internal energy of the system as the work done simply leads to the change in the position of the COM, while the constituents stay the way  they were wrt COM.
So what about the earlier $\Delta U=w$? For the example case, this would truly be a change in the internal energy if the system was expanded to include earth. Now a displacement leads to a change in the internal parameter of the system: its configuration.

For the sake of completeness, when displacement in an external field does lead to change in internal state of a system, then the $\Delta U=w$ holds in the above thermodynamic sense. For e.g., a magnetic material in a non-homogeneous magnetic field, tidal heating of planets/moons in strong gravitional environments etc
A: From a thermodynamics view point gravity does not influence the internal energy $U$ of the object. That is, the change in internal energy, $\Delta U$, due to gravity is unequivocally zero, as stated by @Chet Miller. 
On the other hand, changes in gravitational potential energy and the kinetic energy of the object as a whole are accounted for in the total energy change of the object, $\Delta E$, as given in the more general form of the first law per Chet's answer. 
In most cases for closed thermodynamic systems (no mass flow) changes in kinetic and gravitational potential energy are negligible, and therefore omitted from the first law equation. 

Are my assumptions about internal energy incorrect or is there
  something totally wrong about my approach?

If your approach was correct, then the change in internal energy of an ideal gas for a reversible isothermal process would not be zero due to gravity. For an ideal gas the change in internal energy, $\Delta u$, depends only on temperature change and is $\Delta u=c_{v}\Delta T$. So for gravity to change the internal energy of an ideal gas due to lifting it in a gravitational field, it would have to cause the temperature of the gas to increase. 
Do you think if you simply lifted an insulated rigid  container filled with an ideal gas off of a table, its temperature would go up?  Obviously, that does not happen. 
Hope this helps.
