The on-the-surface instance of your problem
is sometimes known as the *Thomson problem*, after J.J. who posed the problem
over a century ago.
There is [a detailed Wikipedia page](http://en.wikipedia.org/wiki/Thomson_problem)
on the topic.
The $n=5$ case was only settled in 2010—"a rigorous computer-assisted proof"
established that the *triangular bipyramid* is the unique minimizer of
the Coulomb potential.

> Richard Evan Schwartz.
"The 5 Electron Case of Thomson's Problem."
2010.
[arXiv link](http://arxiv.org/abs/1001.3702)

> "In the [triangular bipyramid], two points are antipodal points on [the sphere] and the remaining
3 points form an equilateral triangle on the equator midway between the
two antipodal points":

<br />
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<img src="https://i.sstatic.net/Koi2S.png" width="300" />
<br />
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;<sup>(Image from brakke @[this link](http://www.shapeways.com/model/428975/triangular-dipyramid-70mm.html))</sup>
<br />
Many other candidates for minimal energy configurations have been identified but
not rigorously proven.
For example, for $n=14$, it seems that the *gyroelongated hexagonal dipyramid* is
the minimal energy configuration (combinatorially).