Studying vector calculus you learn to prove that a particle moving in a gravitational field will, in that field respect that $dU=-dW$. From this you can conclude $U_2+K_2=U_1+K_1$.
This is easy to prove in here but I fail to see how to prove it for, suppose, $n$ charged particles or massive particles.
How can I prove such a thing? Namely, prove that $U_2+K_2=U_1+K_1$ is true if the nature of all the forces in your system are conservative (irrotational). Obviously here $U_j=\sum_i U_i$ and $K_j=\sum_i K_i$, i.e., at snapshot (2) $U_2$ is the sum of all the potential energies in the system, and the same for kinetic energy.