We start a game with 2 euros, i.e. at time 0 we have 2 euros. At time $t=1,2,...$ we play a game with a stake of 1 euro and with odds of winning $p$ (hence odds of losing $1-p$). We define $X_t$ at time $t$ as the amount of euros we have at time $t$. Our goal is two get 4 euros. If we reach that goal, we stop, and we also stop if we don't have any money left.
Apparently the stochastic matrix for this situation is given by
$$P = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 \\ 1-p & 0 & p &0 & 0 \\ 0 & 1-p & 0 & p & 0 \\ 0 & 0 & 1-p & 0 & p \\ 0 & 0 & 0 & 0 & 1 \end{pmatrix}$$
But there's little to no explanation of it in the textbook I'm reading. What do these entries represent? What do the rows have in common, what do the columns have in common?
The matrix entries give the conditional probability of moving from a particular state (given by the rows) to another state (the columns) in one turn.
So the top row says that if you start a turn with $0$ you will end that turn with $0$ with probability $1$. Similarly the bottom row says that if you start a turn with $4$ you will end that turn with $4$ with probability $1$. In effect, with either $0$ or $4$, you stop changing state.
The middle three rows say that if you start a turn with $1$, $2$ or $3$ then the probability you end with one more is $p$ and the probability you end the turn with one less is $1-p$.
Note that each row of the matrix sums to $1$.