I know this is an old question, but for the benefit of people visiting here wondering what the answer was, here it goes:
A droplet can stay at rest on an inclined plate because of small heterogeneities on the surface. This can either be a small roughness (of the order of nano/micrometers) or `dirty' spots where the surface chemistry is locally different.
The existence of these heterogeneities allows the droplet to have a different, bigger, contact angle at the downhill side then at the uphill side (this means that a perfectly smooth, clean surface will not be able to hold any droplets, this can most easily be shown by numerical simulation, because a perfectly smooth and clean surface is very hard to find/make experimentally). This difference in contact angle, thus surface energy, translates into a force pointing upwards, which is therefore able to counteract the gravitational force. Because there is a certain maximum to the front and rear contact angles (which depends on the surface roughness/dirtyness, higher roughness/dirtyness will give a larger difference between the two) the droplet will at some point start to move, at which point you get into the paradoxical discussion that Ron Maimon was talking about.
The balance that you get looks like this:
$$
\rho V g \sin \alpha = k \gamma w (\cos\theta_u - \cos \theta_d)
$$
where, in order of appearance, you have the density of the liquid, the volume of the droplet, the gravitational acceleration, the sin of the tilt angle, a `fudge' factor of O(1) depending on the detailed shape of the droplet, the width of the base of the droplet and the cosines of the uphill contact angle and the downhill angle.
The phenomenon of the difference in downhill and uphill contact angle is called contact angle hysteresis. If you want to know more about it, you can google for it: there are plenty of good sources out there.
To summarize: local heterogeneities on the surface allow a difference in surface energy at the front and rear of the droplet, thus introducing a force that can counteract gravity.
This is harder than it sounds.
There are three things to consider.
- For a very narrow tube, for example $\lt 1~\rm{mm}$ diameter, the surface tension will be able to support a column of liquid - even if the other end of the tube is open. The pressure difference that can be sustained across a curved liquid surface with radius of curvature $R$ is calculated as the force on the circumference ($F = 2\pi R \gamma$) divided by the area $\pi R^2$, giving $\Delta p = \frac{2\gamma}{R}$. As the tube gets narrower, you will be able to sustain longer and longer columns of liquid.
- If you have a slightly larger tube, atmospheric pressure will be the significant term (this requires the other end of the tube to be closed...). In principle, you can support a column of 10 m of water at normal atmospheric pressure; in practice, the saturated vapor pressure of liquid means that the pressure above the liquid will not be 0, and there will be some temperature dependent correction. I discussed this in this earlier answer to a related question.
- There will come a size of tube where atmospheric pressure cannot hold the liquid in, because of instability of the liquid surface. The problem is that if the surface can distort, there will be parts at higher (internal) pressure than others. What this means is that when the tube gets large enough that surface tension no longer defines the shape of the surface, an air bubble will be able to "sneak past" the water surface, and liquid will pour out. This doesn't depend so much on the height of the liquid column, as on the diameter of the orifice.
I have never seen that calculated explicitly, but I believe the following argument should allow us to estimate the approximate diameter. We know the pressure difference across the surface due to surface tension scales with the inverse of the radius of curvature. If we assume, generously, that the surface curves "to the maximum", then when the differential gravitation-induced pressure becomes comparable to the surface-tension induced pressure difference, things become unstable. In other words,
$$\frac{2\gamma}{R}\approx \rho g R\\
R \approx \sqrt{\frac{2\gamma}{\rho g}}$$
Substituting typical values for water, we find that the critical diameter of a tube that won't hold water when turned upside down is
$$R\approx \sqrt{\frac{2\cdot 0.07}{1000\cdot 10}}\approx 3.7 mm$$
This suggests that a tube with a diameter greater than about 7 mm will no be able to "hold" a column of water when turned upside down, which is certainly on the right order of magnitude. Note that in the above simplified analysis I ignored the effect of "contact angle" which reduces the pressure differential for hydrophilic surfaces (since the radius of curvature would increase to greater than the radius of the orifice). I think that's outside the scope of the question...
Best Answer
tl;dr: yes, the potential energy increases. Surface effects (surface tension leading to capillary action) provide the requisite energy, but the water will eventually stop rising as the weight of the water in the thread balances the surface tension.
Rather than discussing threads, I'm going to do as Lubos suggests and consider a capillary tube---a very small tube up which water will rise. This preserves the essential physics (contact between water and a surface) while simplifying matters enough that we can perform some explicit calculations.
Suppose, for the sake of concreteness, that the glass is a cylinder of radius $r$ and that the water has an initial height (before you put the capillary tube in) of $h$. Then the center of mass of the water is at $h_{cm} = h/2$, and the initial gravitational potential energy is $$ U_{grav} = \rho V g h_{cm} = \frac{1}{2}\rho \pi r^2 h^2 $$ (where I've written the $\rho$ for the density of water and put the zero of gravitational potential energy at the bottom of the glass).
If, then, you put a cylindrical capillary tube of radius $\delta r \ll r$ into the glass of water, and the water rises to a level $l$ above the new surface of the water in the glass, then we have a volume $$ V_{tube}' = \pi \delta r^2 l $$ of water in the tube, and $$ V_{glass}' = \pi r^2 h - V_{tube}' = \pi r^2 h \left(1 - \frac{\delta r^2}{r^2} \frac{l}{h}\right) $$ in the glass proper. The surface of the water in the glass is now at $$ h' = V_{glass}'/(\pi r^2) = h \left(1 - \frac{\delta r^2}{r^2} \frac{l}{h}\right) $$ so the center of mass of the water in the glass is at $$ h_{cm}' = h'/2 = h_{cm}\left(1 - \frac{\delta r^2}{r^2} \frac{l}{h}\right) $$ and the gravitational potential energy of the water in the glass is $$ U_{grav, glass}' = \rho gV_{glass}'h_{cm}' = \rho g\pi r^2 h^2/2 \left(1 - \frac{\delta r^2}{r^2}\frac{l}{h}\right)^2 $$ To next-to-leading order in $\delta r$ (since $\delta r \ll r$, $\frac{\delta r^2}{r^2}$ is small and $\frac{\delta r^4}{r^4}$ is very tiny indeed, so I can ignore it), this is $$ U_{grav, glass}' \approx g\rho \pi r^2 h^2/2 \left(1 - 2\frac{\delta r^2}{r^2}\frac{l}{h}\right) = U_{grav} - g\rho\pi r^2 h^2 \frac{\delta r^2 l}{r^2 h} $$ The height of the center of mass of the water in the capillary tube is $$ l/2 + h' = l/2 + h \left(1 - \frac{\delta r^2}{r^2} \frac{l}{h}\right), $$ so the potential energy of that water is $$ U_{grav, tube}' = \rho V_{tube}' g (l/2 + h') = \rho g \pi \delta r^2l \left[l/2 + h \left(1 - \frac{\delta r^2}{r^2} \frac{l}{h}\right)\right]; $$ to next-to-leading order in $\frac{\delta r}{r}$, this is $$ U_{grav, tube}' \approx \rho V_{tube}' g (l/2 + h') = \rho g \pi\delta r^2l(l/2 + h). $$ At last, we can write down the total gravitational potential energy of all the water: $$ U_{grav}' \approx U_{grav} + g\rho\pi \delta r^2l^2/2 $$
To answer the first part of your question, the gravitational potential energy of the water does change. As you mentioned in your reply to Lubos, the drop in the level of the water in the glass does offset the increase in (gravitational) potential energy, but not totally.
So far, so good: I've been able to make a reasonably straightforward calculation of the gravitational potential energy of the two configurations, and compare them. The concepts are from freshman physics, and the techniques aren't hard to follow.
The thing is, the gravitational potential energy is not the only energy in this situation, and that's where the question gets complicated. There's also an energy associated with every interface---every surface of contact between two different materials.
If you ponder a little while, that statement becomes pretty obvious. Think about a kid blowing a soap-bubble: he has to do some amount of work (call it $\delta W$) by blowing on that little thing shaped like a Quidditch goal in order to increase the surface area (inside and out) of the bubble. We define the surface tension $\gamma$ as $$ \gamma = \frac{\delta W}{\delta A} $$ (more or less---in actuality, we have to pass to the derivative: consider very small $\delta W$ and $\delta A$. For a slightly less intuitive example in which the surface tension comes out a bit more nicely, without having to pass to a derivative, see https://en.wikipedia.org/wiki/Surface_tension#Two_definitions). I don't actually understand what causes surface tension; I assume it's inter-molecular forces (e.g. van der Waals or polar forces), but I'd like to see some calculations, or better yet experiments, bearing that out. So that's one part of the answer: the surface tension, and ultimately the forces between the water molecules, provide the work required to draw the water up into the tube.
But that's not the whole story. Naively, even when we take surface tension into account, the minimum energy condition would seem to be a perfectly flat surface. Keeping the level of the water thus at $h$, inside the tube or outside, would certainly minimize the surface area of the water. Nor does saying ``surface tension!!one!'' really constitute an explanation.
In order to come up with a satisfactory explanation, we have to shift from thinking about energies to thinking about forces. One can think of surface tension as a sort of analogue to pressure: it tells you how much force is exerted across a line of given length drawn along an interface between two substances. Surface tension is to the length of a line along an interface as pressure is to the area of the interface.
This has a surprising result: that at an ideal three-way interface, for example at (an idealized version of) the edge of a droplet sitting on a table or the place where the water meets the capillary tube, the liquid makes a specific angle with the solid. In this case, there are three relevant sets of interfaces, each with its own surface tension: liquid-gas ($\gamma_{LG}$, water and air), liquid-solid ($\gamma_{LS}$, water and the glass of the capillary tube), and gas-solid ($\gamma_{GS}$, air and glass).
If the whole situation is in equilibrium, we can do a force balance: the horizontal component of the force due to the solid-gas surface tension has to equal the sum of those due to solid-liquid and liquid-gas surface tensions. Otherwise, the interface would be moving. Writing $\theta_e$ for the contact angle, the angle between the solid and the liquid measured through the liquid (that is to say, on the liquid side of the interface), and dividing through by the length of the three-way interface, $$ \gamma_{GS} = \gamma_{LS} + \gamma_{LG} \cos\theta_e. $$ This is Young's Equation (https://en.wikipedia.org/wiki/Wetting#Simplification_to_planar_geometry.2C_Young.27s_relation); solving for the contact $\theta_e$, $$ \theta_e = \cos^{-1}\frac{\gamma_{GS} - \gamma_{LS}}{\gamma_{LG}} $$ This immediately rules out the all-horizontal case, which would require $\theta_e = 0$, or $$ \frac{\gamma_{GS} - \gamma_{LS}}{\gamma_{LG}} = \frac{\pi}{2} $$ which is not the case for water.
It also give us a clue as to how to proceed: the vertical component of the force due to surface tension very near the three-way interface between water, air, and tube is $\gamma (2\pi r) \cos \theta_e$; this force must balance the weight of the water in the tube, which is $r (\pi r^2) l \rho$ in the notation from the first part of this answer. At last, we see that surface tension draws the water up to a height $$ l = \frac{2\cos\theta_e}{rg \rho} $$
So: yes, the potential energy increases. Surface effects (surface tension leading to capillary action) provide the requisite energy, but the water will eventually stop rising as the weight of the water in the thread balances the surface tension.
For more information:
There's Wikipedia, of course: look at the articles on surface tension, capillary action, and contact angle. I also used
Note in particular problems 2 and 3.This book leaves a great deal for the reader to figure out on his own. I'm coming to believe that that is usual in the Course of Theoretical Physics.
Much more explicit is
from which I drew (with modification) my calculation of the height to which capillary action draws the water. Note in particular example 1. This appears to be an undergrad engineers' textbook.
For more information on wetting---how liquids interact with solid surfaces in general---you might try Wikipedia, of course, but also
Though I've only read a little bit and can't vouch for its quality myself, it appears to be frequently cited, so that's something.