Franz, to complement Karl's answer let me remark that actually you cannot expect a formula without further conditions. I will use your notation.

If $X$ is singular, $K_X$ may not be *Cartier* or even $\mathbb Q$-Cartier (i.e., that some non-zero integer multiple would be Cartier). Without this it is hard to make sense of the pull-back $p^*K_X$. There are various ways to deal with this, but at the beginning you might not want to deal with those difficulties. One way to get around this problem is to add a divisor $\Delta$ to $K_X$ so that $K_X+\Delta$ is $\mathbb Q$-Cartier and compare that to $K_Z+\Delta_Z$ where $\Delta_Z=p^{-1}_*\Delta$, the strict transform of $\Delta$ on $Z$. However, then you get slightly different values.

So, anyway, perhaps you would want to assume that $K_X$ is $\mathbb Q$-Cartier before you do anything else. Next, let $E=\cup E_i$ denote the exceptional divisor of $p$ (it is not necessarily irreducible!). Then obviously there exists a formula:
$$
K_Z\sim p^*K_X + \sum a_i E_i.\tag{$\star$}
$$
Notice that if $K_X$ is itself not Cartier, then the $a_i$ may not be integers. See this for some examples.

Anyway, the point I want to make is that the $a_i$ that may appear are strongly related to the singularities of $X$ along $Y$. You can think of them as a measure of how bad those singularities are: the smaller (usually more negative) the $a_i$ the worse the singularity. The ones that are somewhat nicer and manageable are the ones for which $a_i\geq -1$. For more on this you should look up a survey or a book on the minimal model program and the singularities that it can deal with.

Finally, as Karl already pointed out, pretty much anything can happen as far as what values the $a_i$ can take. I guess there is an upper bound, but that is the easy direction. Otherwise, take your favorite smooth projective variety $T$ with your favorite embedding into a projective space and let $X$ be the cone over $T$, and $Y$ the vertex. If you blow up $X$ at $Y$, then you get a smooth variety and the exceptional divisor $E$ will be isomorphic to $T$. Now take your formula from $(\star)$ and apply adjunction. You'll get:
$$
(a+1)E|_{E}\sim K_T.
$$
From the construction you see that $E|_E$ is isomorphic to the inverse of the hyperplane class coming from the original embedding of $T$, so by choosing your $T$ and the embedding wisely you can get all kinds of values for $a$. For instance if $T\subset \mathbb P^n$ is a degree $d$ hypersurface, then $K_T\sim (d-n-1)H$ and $E|_E\sim -H$, so you get that
$$
a= n-d.
$$
This already shows that any integer is possible. Taking quotients as in here gives you fractions.