Multi-electron Atom
The notation of the last sum may not be perfectly clear. It is actually a double summation: both $i$ and $j$ run from $1$ to $n$. So, for instance, it includes $i=1, j=2$ and $i=2, j=1$. But really there is just one interaction between $1$ and $2$. So the double sum is divided by $2$.
For a multi-particle system interacting via a conservative force there is one potential $V(\vec r_1, \ldots, \vec r_n)$ dependent on the positions of all particles, not potentials for each particle that must be summed over (although sometimes the potential may decompose into a sum of potentials for the individual particles).
In classical physics, the potential has the property that the $\vec F_i = -\nabla_i V$, that is we get the force acting on particle $i$ by deriving with respect to the position of particle $i$. We will use this to illustrate why we need the factor of $\frac 1 2$.
Now in the case of the Coulomb force acting between the particles the potential must have the property that (for some conveniently chosen unit of charge) $$ -\nabla_j V = \vec F_j = -\sum_{\overset{i=1}{i \ne j}}^n q_iq_j \frac{\vec r_i - \vec r_j}{\left|\vec r_i - \vec r_j\right|^3}. \tag{1} $$ This is just the statement that the force acting on a particle in the system is the sum of the Coulomb forces caused by the other particles.
If we would count "count the potential of every electron with respect to the others", which (I suppose) would mean $$ V = \sum_{i,j=0}^n' \frac{q_iq_j}{r_{ij}} $$ and calculate the force on some particle we get: \begin{align*} \vec F_k &= -\nabla_k \sum_{i,j}'\frac{q_iq_j}{r_{ij}} = -\sum_{i,j}' q_iq_j \nabla_k \frac{1}{r_{ij}} \\ &= \sum_{i,j}' q_iq_j \left( \delta_{ki} \frac{\vec r_i - \vec r_j}{r_{ij}^3} - \delta_{jk} \frac{\vec r_i - \vec r_j}{r_{ij}^3}\right) \\ &= \sum_\overset{j}{j\ne k} q_k q_j \frac{\vec r_k - \vec r_j}{r_{kj}^3} - \sum_\overset{i}{i\ne k} q_i q_k \frac{\vec r_i - \vec r_k}{r_{ik}^3} \\ &= -2 \sum_{\overset{i}{i\ne k}} q_i q_k \frac{\vec r_i - \vec r_k}{r_{ik}^3} \end{align*} which is twice the force we expect as per equation $(1)$. So the factor $\frac 1 2$ is necessary to produce the correct forces.
So, to build up the total potential from the potentials between pairs of electrons, the correct prescription is to add up the potentials for each pair of electrons, as the answer by LonelyProf states. (There are $n(n-1)/2$ pairs but our the double sum over $i$ and $j$ for $i \ne j$ has $n(n-1)$ terms, so we correct for this overcounting by dividing by two).
Yet another way to think about this, is to remember that the potential is the work necessary to bring the charges from infinity to the specified configuration. If we already have a system of $n-1$ electrons and bring in another from infinite, then we only add the potential energy of that electron being moved towards the other, so we only have to count the terms of the form $q_iq_n \frac 1 {r_{in}}$ once, not twice as is done in the sum $\sum_{i,j=1}^n' \cdots$ (which also has the identical term $\frac 1 {r_{ni}}$). This overcounting can be corrected by the factor $\frac 1 2$.