Does the potential energy of fluid rising on a string change? Lets say I have a glass of water at rest. Then I go and hang a string above the water (vertically), such as the end of the string is immersed in the water. Over time some of the water is going to migrate upwards and climb the rope. The water level is going to drop slightly, as the rope gets "wet". Does the total potential energy of the water change, and if yes what provides the energy for the water to do work against gravity? 
If the length of the string a really long, does the water stop climbing at some point? Is all this a result of surface tension on the water?
 A: 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


*

*Landau, L.D. and E.M. Lifshitz. Fluid Mechanics. 2nd English
edition, revised. Trans. J.B. Sykes and W.H. Reid. Course of
Theoretical Physics Vol. 6. Oxford: Pergamon Press, 1986. \S 61,
pp. 238-244.


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


*

*Kundu, Pijush K. and Ira M. Cohen. Fluid Mechanics. 2nd
edition. San Diego: Academic Press, 2002. pp. 9-12.


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 


*

*de Gennes, P.G. (1985). "Wetting: statics and dynamics". Reviews of
Modern Physics 57 (3): 827–863. http://dx.doi.org/10.1103/RevModPhys.57.827 .


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.
A: When the potential energy of a water molecule is defined as $h\rho g$, then it obviously increases when the water molecules get higher. The conservation of energy is guaranteed by properly including the surface tension and, even more precisely, cohesion into the equation, indeed:

http://en.wikipedia.org/wiki/Cohesion_(chemistry)

There is a reduction of the total energy by a term that is proportional to the total area of the surface by which the water is in contact with another material. A proper calculation shows that the cohesion or surface tension may only lift the water molecule to a certain finite weight.
Instead of wet threads, one may study capillary action

http://en.wikipedia.org/wiki/Capillary_action

The logic is the same. Even for the wet threads, the maximum height that the water molecules may climb is finite. However, the finiteness may be obscured by the "very thin" spaces that the molecules effectively climb inside the clothes or threads.
