As is given in Jamie's answer I'll assume the surface is a revolution about $r=0$, that the mean curvature is proportional to the pressure difference, and that the radius of the cup is much larger than the inverse of this mean curvature.
In this case the mean curvature can be specified as
$$ K_m = \frac{r''}{2(1+r'^2)^{\frac32}}$$
As in Jamie's answer the Young-Laplace Equation and hydrostatic pressure give
$$ 2\,\gamma\,K_m = \Delta P = -\rho\,g\,z$$
Placing the origin at the surface and positive z in the direction of gravity.
Combining yields
$$ -\rho\,g\,z = \frac{\gamma\,r''}{(1+r'^2)^{\frac32}}$$
Substituting $q=r'$ yields a first order differential equation
$$ -\rho\,g\,z = \frac{\gamma\,q'}{(1+q^2)^{\frac32}}$$
Integrating
$$ -\frac12\,\rho\,g\,z^2 = \frac{\gamma\,q}{\sqrt{1+q^2}}+C$$
We know that at the very top of the water the surface is flat which would correspond to $q=r'=\infty$ this condition is gives $C=-\gamma$
$$ z= \sqrt{\frac{2\,\gamma}{\rho\,g}(1-\frac{q}{\sqrt{1+q^2}})}$$
Now since $q=r'=tan\,\alpha$ where $\alpha$ is described in the question, $z$ simplifies to
$$ z= \sqrt{\frac{2\,\gamma}{\rho\,g}(1-sin\,\alpha)}$$
Which is indeed the formula given in John Rennie's answer.
So now the question is what alpha to use. I propose that the water will continue expanding around the curved lip of a glass maintaining its contact angle until the point at which going farther along the lip would lower the top of the surface according to the above equation as at that point the surface would be unstable. This depends on the curve of the lip of the glass $r_l$.
If the water edge on the lip of the glass is at polar coordinate $\phi$ and the liquid has a contact angle $\theta$, then $\alpha=\phi-\theta$, and my total height $h$ will be given as
$$ h=\sqrt{\frac{2\,\gamma}{\rho\,g}(1-sin(\phi-\theta))}+r_l\,(sin\,\phi-1) $$
Unfortunately this does not have a closed form maximum over theta, but we can see that for small values of $r$ the maximum will be when $\phi\lt 0$. This is not physical as the liquid would start creeping down the side of the glass and become unstable first. We can solve for the value of r at which this occurs
$$r_l=cos\,\theta\sqrt{\frac{\gamma}{2\,\rho\,g\,(1+sin\,\theta)}}$$
For any lip radius under this value the maximum liquid height would be
$$ h=\sqrt{\frac{2\,\gamma}{\rho\,g}(1+sin\,\theta)}-r_l $$
For water this radius calculates out to about $1mm$ and for a glass with a very small radius the height calculates out to about $4mm$ a bit higher than I've managed, but not unreasonable for a theoretical upper bound.
For glasses with a larger radius the maximum height can be solved numerically. Here's a plot.
And the corresponding "lip contact angles"
Best Answer
The formula for capillary rise that most people know is easily derived through a pressure balance between the capillary pressure and the hydrostatic pressure. The hydrostatic pressure equals $$\Delta P_h=\rho g h$$ whereas the capillary pressure is $$\Delta P_c=\frac{2\gamma}{R}=\frac{2\gamma \cos \theta}{r}$$ So balancing these we get our 'famous' equation: $$h=\frac{2\gamma\cos\theta}{\rho g r} $$ Now we have a situation in which the height of our tube above the liquid, $h_{max}$ is smaller than $h$. For an equilibrium situation we still need the hydrostatic pressure and the capillary pressure to balance so we plug in the maximum height that we can get, $h_{max}$, and get: $$h_{max}=\frac{2\gamma \cos\theta_p}{\rho g r}$$ Note that I have changed $\theta$ into $\theta_p$ (see figure below), because that is in fact the only thing that can change, all the other parameters are fixed properties of the system.
It is not entirely clear how you define $A$, but if we define $A$ as the situation for which $\theta_p=\theta$ then changing $\theta_p$ would result in a gradual shift from $A$ to $B$ depending on the value of $h_{max}$. In fact, $B$ is the limit for $h_{max}=0$, because $\cos \pi/2=0$, in which case, as pointed out by Olin and can be seen from the capillary pressure equation, no hydrostatic pressure can be sustained. The fact that $\theta$ can become bigger (i.e. change into $\theta_p$) is caused by contact angle hysteresis at the rim of the capillary tube.