Is gravitational energy always conserved? If I take a body to a height $h$ then I did the work $mgh$, but gravity does the work of $-mgh$, so the net work done would be 0. So why do we say that at that height $h$ the body will have potential energy $mgh$?
 A: 
so net work done would be 0

Net work of all forces is 0, and that is why kinetic energy of the body does not change - it remains 0. This is an example of the general theorem
$$\text{work of all forces while body moves from A to B} = \text{kinetic energy at B - kinetic energy at A}$$
It does not mean that change in potential energy is zero.
Gravitational potential energy increases when you move the body against the gravity force.
A: There is no relationship between net work and potential energy in general. Potential energy only relates to the work done by the force that is associated with that potential energy.
So for gravity we can say for the work done by gravity and change in potential energy: $$W_{grav}=-mg(h_2-h_1)=-\Delta U_{grav}$$. Assuming the object starts at $h_1$, ends at $h_2$, and $h_2>h_1$ (i.e. the object is lifted up).
Now what about the net work done on the object (the total work done by you and gravity) when we lift the object up and then hold it in place? Well in general the force you supply can be complicated. For example, you aren't going to be applying a constant magnitude of force, and we don't exactly know how this magnitude changes over time. However, we can use the work-kinetic energy relation $$W_{total}=W_{you}+W_{grav}=\Delta K$$
If the object starts and ends at rest, then $\Delta K=0$, so we know the work you do is $$W_{you}=-W_{grav}=mg(h_2-h_1)$$
So we have accounted for all work and energy in the system. Gravity does negative work, which gives the object an increase in potential energy, but the net work is $0$.
A: When you lift a body, you add some potential energy to the body-earth system. 
While doing it, you are performing positive work against the gravitational force, which is an internal force in the body-earth system.
Since the gravitational force is internal, it cannot change the energy of the system and, therefore, its effect should not be counted, when we calculate the final energy of the system.
This is similar to stretching a spring. When you stretch a spring, you perform
positive work against its internal elastic forces and add some potential energy to it, but you don't consider the negative work one half of the spring performs on the other, because the internal forces cannot change the energy of the spring and, therefore, their effect should not be counted, when we calculate the final energy of the spring.  
