There is no simplified description of the Nash equilibrium of this game.
You can compute the best strategy starting from positions where both players are about to win and going backwards from there.
Let $p(Y,O,P)$ the probability that you win if you are at the situation $(Y,O,P)$ and if you make the best choices. The difficulty is that to compute the strategy and probability to win at some situation $(Y,O,P)$, you make your choice depending on the probability $p(O,Y,0)$. So you have a (piecewise affine and contracting) decreasing function $F_{(Y,O,P)}$ such that $p(Y,O,P) = F_{(Y,O,P)}(p(O,Y,0))$, and in particular, you need to find the fixpoint of the composition $F_{(Y,O,0)} \circ F_{(O,Y,0)}$ in order to find the real $p(O,Y,0)$, and deduce everything from there.
After computing this for a 100 points game and some inspecting, there is no function $g(Y,O)$ such that the strategy simplifies to "stop if you accumulated $g(Y,O)$ points or more". For example, at $Y=61,O=62$,you should stop when you have exactly $20$ or $21$ points, and continue otherwise.
If you let $g(Y,O)$ be the smallest number of points $P$ such that you should stop at $(Y,O,P)$, then $g$ does not look very nice at all. It is not monotonous and does strange things, except in the region where you should just keep playing until you lose or win in $1$ move.
When to stop depends on how many rounds you're allowed to play. If you're allowed to play for arbitrary many rounds, you could decide not to stop until you have a million points. Then with probability $1$ sooner or later (most likely much later) you will leave the table with a million points.
So the game is only interesting when there's a time limit after which you must stop playing and leave with whatever you've got at that time if you haven't cashed out before that.
A strategy is a function $f(N,S)$ that gives our decision to either cash out or keep playing as the output of two inputs: $N$ is the number of rounds left, and $S$ is how many points you have when you make the decision. The fact that you're supposed to use dynamic programming is a hint that you're not supposed to find an explicit formula for $f(N,S)$, but rather to compute a table of values for $f(N,S)$.
It is easy enough to analyze what the optimal choice for $N=1$ is. If you quit now your expected winnings are $S$; if you play the last round your expected winnings are $\frac16 0 + \frac56(S+7)$, (since a roll that doesn't bankrupt you wins you 7 points on average). So you should play the last round iff $\frac {5S}6 + \frac{35}6 \ge S$ which is if $S\le 35$.
In order for you to proceed to $N=2$ you need to compute an auxiliary table of the expected value of the game before you make the $f(1,S)$ for various $S$. For large enough $S$ you should always cash out, in which case the expected value is $S$ itself -- so you only need to tabulate the expected values for $S$ less than the cash-out threshold.
Now you can compute $f(2,S)$ as follows: The expected value of walking out is $S$. To find the expected value of playing, consider the various outcomes of the dice roll: you could go bankrupt or win 3, 4, 5, ..., 10, 11 points, each with a particular probablity. Each of these cases take you to a state $(1,S')$ that you have already computed the expected value of; the appropriately weighted average of those expectations is the value of going on. Compare this with $S$ to figure out if you should leave or go on.
Now do the same thing for $f(3,-)$, $f(4,-)$ and so forth, until you reach the actual length of your game.
(Note that the actual strategic decisions can be made in constant time on the fly if only you have tabulated the values of the game at each possible state).
Best Answer
This is more of a discussion point than an answer. Let us assume $c_e < \sum_{i=1}^Nc_i$, otherwise this is a game nobody would play. It would also be illogical to terminate before the player has made the money $c_e$ back during the game (otherwise the player would just not play). Let $R_j=\sum_{i=1}^jc_i$, and let $1 \leq r \leq N$ be the minimum value for which $R_r=\sum_{i=1}^qc_i > c_e$. Let us consider what happens for the strategy "terminate after $k\geq r$ wins".
Notice that for this strategy there are only two outcomes, either the player wins $R_k-c_e$ with probability $p_k=\frac{N}{N+1}\times \cdots \frac{N-k+1}{N-k}=\frac{N-k+1}{N+1}$, or 'wins' $-c_e$ with probability $q_k=1-p_k=\frac{k}{N+1}$. So for each $k$ considered, we find ourselves a bernoulli distribution (on $\{C_k-c_e, -c_e\}$) with probability of success $p_k=\frac{N-k+1}{N+1}$.
At this point, we can look at the expected value $W_k$ for each of these strategies to get $$W_k = R_k\frac{N-k+1}{N+1} - c_e$$
if for any $k \geq r$ we get $W_k>0$, then our strategy is to find the largest $W_k$ and then terminate at $k$ and repeat. That is, if the player is allowed to play this game infinitely many times, then this would be a profitable strategy. This is kind of like playing the lottery, suppose the lottery gave a positive expected return (which it doesn't in reality), then playing the lottery infinitely often should result in a net profit over time, though playing it once is highly likely to result in a net loss.
So now suppose the player is only allowed to play the game once, then now it's a matter of a single bernoulli trial. Notice that for our strategy to terminate at $k$, $p_k$ is monotone decreasing in $k$, so we want to use the smallest posible value $k$. However, we also do not want to make any losses, so the smallest possible value of $k$ for which we still can make a profit is $r$, i.e we should terminate as soon as we win more money than we paid to play the game. Having said this, if $p_r$ is quite small (say $10\%$) then we win with only $10\%$ chance and it may not be worthwile for the player to play the game in the first place. One could argue that a large $R_r$ might make the game worthwile, but now this is a matter of personal opinion. Would you like to bet $£100$ say to win $£1001$ with $10\%$ chance? How about to win $£10001$ with $1\%$ chance?. Of course if we can play the game infinitely often, then these numbers are worthwile, but if we can only play once, most people would not play.
If say we are a casino trying to implement this game, we should ensure