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 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
"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":
(Image from brakke @[this link](http://www.shapeways.com/model/428975/triangular-dipyramid-70mm.html))
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).
For a deeper look:
Cohn, Henry, and Abhinav Kumar. "Universally optimal distribution of points on spheres." Journal of the American Mathematical Society. 20.1 (2007): 99-148.