Can gravity ever be considered a non-conservative force? I came across this definition of a conservative force: 

"conservative force is a force which doesn't change the total mechanical energy". 

So does that mean that if gravity is an external force to your system it can be considered to be a non-conservative force?
 A: That's a terrible definition of conservative force. By the logic of that definition, there are either no conservative forces, or the definition of "conservative" depends on your choice of system (which means that a force alone can never be "conservative;" it's only conservative with respect to certain systems. The fact that we refer to gravity as a "conservative force" without reference to a system should convince you that this is an improper definition). Here's a proof of that statement:
Let $F$ be a conservative force. We can interpret the definition two ways: either
a) $F$ conserves the mechanical energy of a particular system, or equivalently some set of particular systems; or
b) $F$ conserves the mechanical energy of every system.
If we assume a), then the definition of "conservative force" doesn't depend on only the force; it requires a force and a choice of system(s). A force, under a), can only be conservative with respect to a particular system. Since I can always choose a system in which $F$ is external, then there is no way to say that $F$ is "conservative" without respect to a given system. This is an improper definition for the reasons in parentheses above.
If we assume b), then if $F$ is conservative, it conserves mechanical energy in every system. Let's choose one such system. We can always construct a new system in which $F$ is external, meaning that it does not conserve mechanical energy. Therefore, $F$ does not conserve energy in every system, so $F$ is not conservative. This is a contradiction, so there are no conservative forces under this definition.
The proper definition of "conservative force" is the following:
A force is conservative if and only if it can be written as the gradient of a scalar function $U$, which is often called the "potential."
This ensures that we can have a system-independent, logically consistent definition of conservative, and as such, this is (one of) the (many equivalent) definition(s) we actually use.
A: As mentioned already the definition of a conservative force given in the question is not precise. A conservative force is a force whose work done on a system in a loop is zero. Mathematically one can express the same definition as 
$$\vec{\nabla} \times \vec{F}=0$$
If a force follows this relation then it is conservative. In case of gravity the force in spherical coordinates is 
$$F_r=\frac{GMm}{r²}$$
$$F_{\theta}=F_{\phi}=0$$
Using the relation for curl in spherical coordinates given here one can obtain the relation
$$\vec{\nabla}\times \vec{F}_{gravity}=0$$
Hence gravity is a conservative force in every frame. 
A: An external force is one which alters the mechanical energy of a system , hence if mechanical energy is given by PE + KE ..therefore gravity has already been accounted for ...and due to this can't be considered an external force since it will never change the total mechanical energy of a system ,hence gravity is not considered an external force
A: Consider the total mechanical energy $E$, being the sum of a potential energy $V(\mathbf{x})$ and kinetic energy $\frac{1}{2}m\left ( \frac{\mathrm{d}\mathbf{x}}{\mathrm{d}t}^2 \right )$:
$$ E = \frac{1}{2}m\left ( \frac{\mathrm{d}\mathbf{x}}{\mathrm{d}t}^2 \right ) + V(\mathbf{x}),$$ which is termed mechanical energy.
For this to be conserved, i.e. a constant in time, then its total time derivative must vanish:
$$ \frac{\mathrm{d}E}{\mathrm{d}t} = 0, $$
where by the chain rule:
$$ \frac{\mathrm{d}E}{\mathrm{d}t} =  \sum_{k=x,y,z} \left [ m\frac{\mathrm{d}x_k}{\mathrm{d}t}\frac{\mathrm{d}^2x_k}{\mathrm{d}t^2} + \frac{\partial V}{\partial x_k}\frac{\mathrm{d}x_k}{\mathrm{d}t} \right ] =  \sum_{k=x,y,z} \left ( m\frac{\mathrm{d}^2x_k}{\mathrm{d}t^2} + \frac{\partial V}{\partial x_k}\right )\frac{\mathrm{d}x_k}{\mathrm{d}t} = 0.$$
You recognise the first term $ m\frac{\mathrm{d}^2x_k}{\mathrm{d}t^2}  $ as the expression for the force $F_k$ in Newton's second law. 
The equality is satisfied only if $m\frac{\mathrm{d}^2x_k}{\mathrm{d}t^2}   = F_k = -\frac{\partial V}{\partial x_k}$, meaning $\mathbf{F} = -\nabla V$.  In such a case, the force would be called a conservative force.
There are a lot of equivalent definitions for a conservative force, all which stem from the essential one: a conservative force is any force that can be written as the gradient of a potential $\mathbf{F} = -\nabla V$.


*

*By the rules of vector calculus, $\nabla \times \mathbf{F} \propto \nabla \times \nabla V = 0$, so any conservative force field has no vorticity, $\nabla \times \mathbf{F} = 0$.

*By Stokes's theorem, the above constraint can be made into a path integral one: $\iint \nabla \times \mathbf{F} \cdot \mathrm{d}\mathbf{S} = \oint \mathbf{F} \cdot \mathrm{d}\mathbf{x} = 0$ for any path, since the left hand side is always zero, regardless of the surface $\mathbf{S}$. So any conservative force is path independent. 
