Source-free RC circuit current directions
Technically speaking, your textbook is probably using the convention typical for the loads, ie current enters from the + terminal and exits the - terminal. For the generators the opposite is true.

A capacitor is a load, although in this case it is releasing the energy stored in it and acting as a "generator". This is why your book is using that convention.

Note, however, that this doesn't really matter that much since you can easily:


Realise that current direction in a circuit is purely a convention and, once the result is found, the sign of the current will indicate the actual direction of the "conventional current". As long as you remain consistent with the load and generators conventions, as mentioned above, you'll get correct results.
Apply KCL at the single node and therefore obtain : $$i_c = -i_r$$




Adding an EDIT in order to be more clear and trying to address the user concerns:

If you want a systematic way of solving these exercises, this is probably close to that:




In case 1 (in order, LKT, capacitor i,v relationship, and LKC):

$$
\left\{\begin{matrix}
v_c = v_r
\\ 
i_c = C\frac{dv_c}{dt}
\\ 
i_c = -i_r = \frac{-v_c}{R}
\end{matrix}\right.
$$

which gives:

$$\frac{-v}{R} = C\frac{dv_c}{dt}$$

reorder it:

$$\frac{v}{R} + C\frac{dv_c}{dt} = 0$$

Initial and final conditions:
$$\left\{\begin{matrix}
v_{c0}= V_0
\\ 
v_{\inf} = 0
\end{matrix}\right.$$

General solution form: $$v_c = A e^{\gamma t} + B$$
Find A and B by applying initial conditions. $$A = V_0, B=0$$ and $$\gamma = -\frac{1}{RC}$$ found from solving the associated equation to the differential equation given:

$$v_c = V_0 e^{-\frac{t}{\tau}}$$

which in turn gives:

$$i_c = - \frac{V_0}{R} e^{-\frac{t}{\tau}}$$

Note that the current will be negative for t>= 0, meaning that it is actually flowing in the opposite direction of the one assumed.

In case 2 instead, the initial conditions are different due to the different conventions adopted. But LKC and LKT still hold as long as you have kept the right conventions for both current and voltage:

$$
\left\{\begin{matrix}
v_c = - v_r
\\ 
i_c = C\frac{dv_c}{dt}
\\ 
i_c = i_r = \frac{v_c}{R}
\end{matrix}\right.
$$

which still gives the exact same differential equation as in case 1 but with different initial conditions since the voltage at time 0 was measured as positive in the "opposite direction":

$$\left\{\begin{matrix}
v_{c0}= -V_0
\\ 
v_{\inf} = 0
\end{matrix}\right.$$

solving as in case 1 gives:

$$v_c = -V_0 e^{-\frac{t}{\tau}}$$

which in turn gives:

$$i_c = \frac{V_0}{R} e^{-\frac{t}{\tau}}$$
now always positive for t>=0.

BIG WARNING NOTE:: This procedure is ok for a simple RC network however when solving a more complex RC network there is a more general procedure to follow which includes this particular easy case. Look for it in a circuit theory book such as "Basic Circuit Theory" by Charles A. Desoer and Ernest S. Kuh.