Can the electric or gravitational potential be discontinuous? Why? I was solving the Laplace's equation for the charger thin spherical shell and noticed that the field is discontinuous at the surface (inside it is zero and outside it is proportional to $1/r^2$) but the potential is continuous even at the surface. I am wondering that, is it physically possible that the potential could be discontinuous, in any case.  
 A: Yes, electric potential can change discontinuously.
All discrete, abrupt changes of anything are idealizations.  Real objects have no discontinuities.  But our idealized models can have discontinuities, and you used such a model in solving the problem of the charged shell.  In a real shell, the charge density would not change abruptly, and the E-field would not be discontinuous, though it might have a very large slope over a very small distance.
Another idealized charge distribution is the dipole layer.   For an infinitely thin dipole sheet, the potential will change discontinuously as you move from one side to the other.  (The electric field, however, will be continuous.)   
"Thin" (whatever you mean by "thin") dipole layers exist in, e.g. semiconductor p-n junctions.  A simple model of a p-n junction treats the layer as a zero-thickness sheet.  Of course, you can only go so far with that model.
You can convince yourself of all of this by drawing a picture of an infinite parallel plate capacitor (a non-zero-thickness dipole layer) and considering the potential on either side and within the capacitor, and the electric field inside and out (use Gauss' Law,  assume there is some field incident on the capacitor from outside, and see what Gauss' Law says about the field as  you cross the layer).   Then imagine the separation of the plates goes to zero.
I don't know about gravity.  It seems it should not be possible because there is no way to form a dipole sheet.  Extended objects can have a gravitational dipole moment, I suppose.   But I leave it to someone else to give a good answer to that question.
update after comment (thanks)
When shrinking the plate separation of the capacitor, the charge density has to increase in such a way that $\Delta V = \sigma d /\epsilon_0$ remains constant.  
A: Well the potential $(\phi, A)$ generates the fields $E = -\dot A - \nabla \phi,\; B =\nabla\times A.$ This is important because it reminds you that $\phi$ is a theoretical abstraction which we use to study the real physical things we're interested in, and so we can have a lot of freedom here.
If $A = 0$ and $E$ is undefined on the boundary of some volume, then there is nothing in general forcing you to make $\phi$ continuous across that boundary: in any case it has some sort of "kink" that makes it not differentiable, but you can shift them also by any additive constant and you'll still have $E = -\nabla \phi$ wherever $E$ is defined. So it's important to see that you've chosen to make the potential well-defined across the boundary.
Now, are you ever forced into a situation where $-\nabla^2 \phi = \rho/\epsilon_0$ generates a potential which can't be continuous across two surfaces?
Yes, but let me first offer a restriction: Suppose that you have a volume $V$ in a space $\Omega$ with some boundary $\partial V$ separating $V$ from $\Omega - V$. We solve the Poisson equation for $V$ and we find that it has some potential $\psi$ on $\partial V;$ then there is probably a twice-differentiable extension of $\psi$ to the entire space $\Omega - V,$ whence we can solve $-\nabla^2 u = \rho/\epsilon_0 - \nabla^2 \psi,$ with the boundary condition that it is 0 on $\partial V.$ There's no reason to think that this boundary condition cannot be satisfied, so then $u + \psi$ works as a valid $\phi$ which is continuous across the boundary.
So, the counterexamples probably fall into a couple classifications:


*

*Cases where we choose a potential discontinuity as a boundary condition without an enclosed volume. The best example of this is if you shrink a parallel-plate capacitor to be infinitely thin with certain assumptions, so that we're talking about $\mathbb R^3$ minus the finite plane $z = 0, x^2 + y^2 < r^2$ for some $r$. The boundary conditions of this space are potential $+V/2$ on the one side, $-V/2$ on the other side, and then by definition the potential is discontinuous.

*Cases where the inside of $V$ is not simply connected. If we remove the center axis from a cylinder, for example, we can get the continuous curl-free field $E = V_0 \hat \theta / r.$ This has a potential inside of $V$ but you have to choose a surface that makes it discontinuous, because $V$ is not simply connected and so traveling around a loop may lead to a discontinuity.

*This is the one I'm most shaky on, but: cases where the potential has a "kink" in it but is not discontinuous. Again, taking the infinite cylinder: we can insert a thin sheet of some charge density $\sigma$ for $r > R$ at $\theta = 0$. There is no reason for this to generate a discontinuous potential outside of $V$, but there will be a predictable kink in it at $\theta = 0$ at the boundary, and this cannot therefore be extended to a twice-differentiable function. Inside of $V$, it may be possible that this discontinuity "amplifies" to an all-out discontinuity at $r = 0.$ (By default I can tell you that the nature of $\nabla^2$, as it also appears in diffusive contexts, is to "smooth out" discontinuities, so I think you would have to try to "pin it down" somehow.

