Gravitational force is a conservative force because the work done against gravity is always conserved.
For example: when we throw an object vertically above to the height of h metre then the work done against the gravity is
W'=mgh
where, mass of the object =m
height =h
acceleration due to gravity =-g
and when the object falls back from the same height the work done is
w" = mgh
Here the total work done, W=W'+W"\\
W=-mgh+mgh=0
Hence the total work done in travelling certain height and falling back to same place is zero, this is the property of conservative ford as the total work done depends only on the initial and final position of the object. Since the distance travelled is zero, the work done must be zero which is the same here.
That's why gravitational force is a conservative force.
Forces that do not store energy are called non-conservative of dissipative forces.
Friction force is an example of a non-conservative force because it do not store energy rather than storing it.
Frictional force oppose the motion of the object i.e.
fi∝−Δri
Thus the net work done by frictional force is negative as,
ΔW=∑ifiΔri=−∑i|fi|Δri|<0
Negative sign indicates that the frictional force continually drains energy from the object as it moves over the surface . So it disipates energy in the form of heat.