Here is a mathematical justification. I will assume a knowledge of some vector calculus, so feel free to ask questions if you have any issues.
Let $\textbf{F}$ represent the (conservative) gravitational force (a vector) at every point in space. Now, imagine that an object begins to fall through this vector field. Assume that the object begins at point $A$ and ends at point $B$. If $K$ represents the kinetic energy of the free-falling object, then we have that
\begin{equation}
\Delta K = \frac{1}{2} m (v_b^2-v_a^2) = \int_A^B \textbf{F} \cdot d\textbf{S} \; \; \; (\textrm{i})
\end{equation}
Now, imagine you have some other object at point $A$. You throw this object straight up into the air at some initial velocity $v_A$. You will find that when it comes back down to A, its velocity is $v_A$. That is, when the object takes this specific closed path from $A$ to $A$, $ \: \Delta K = 0$. Indeed, if this object takes any closed path from $A$ to $A$, you will find that $\Delta K = 0$. Hence, by equation (i), we have that
\begin{equation}
0 = \oint \textbf{F} \cdot d\textbf{S} \; \; \; (\textrm{ii})
\end{equation}
As it turns out, equation (ii) means that means that we can define a "potential energy" function $U$:
\begin{equation}
\textbf{F} = -\nabla U \; \; \; (\textrm{iii})
\end{equation}
Taking the line integral from $A$ to $B$ of both sides of equation (iii) yields
\begin{equation}
\int_A^B \textbf{F} \cdot d\textbf{S} = \int_A^B -\nabla U \cdot d\textbf{S} = -U(B)-(-U(A)) = U(A)-U(B) = -\Delta U \; \; \; (\textrm{iv})
\end{equation}
Now, the total mechanical energy $E$ of the system is given by $E = U+K$. That is, $\Delta E = \Delta U+ \Delta K$. By equations (i) and (iv), we have that $\Delta E = 0$. In other words, the mechanical energy of the system remains constant between any two points $A$ and $B$.