How to choose the state variables in a dynamic programming

A state variable is everything that cannot be changed at time t. For example, the capital stock k_ {t-1} in your stock at the end of period notation is a state, because it is used for production at time t, but cannot be changed anymore at time t, because that would require changing yesterday’s investment (i_{t-1}).

This is the general rule: everything that is relevant at time t, but cannot be changed anymore is a state.

The example you describe is special in the respect that the authors are only interested in the total evolution of wealth, not in the one of the subcomponents. In this case, a composite state variable can be defined. That would not be possible if you would like to know the evolution of the variables separately.