Just to define the concepts:
Given a Hilbert space ${\mathcal H}$, there always exists a complete set of distinct, but commuting observables $\{ {\hat O}_1, {\hat O}_2, ...,{\hat O}_m \}$, $\left[{\hat O}_j, {\hat O}_k \right] = 0$, whose common eigenstates define a basis of ${\mathcal H}$ labeled exhaustively by the eigenvalues of each ${\hat O}_k$. This means that to each unique m-tuple of eigenvalues of the ${\hat O}_k$-s there corresponds a unique common eigenstate (no degeneracies). We can identify the observables in the complete commuting set as the "degrees of freedom" of the system described by ${\mathcal H}$. Note however that the definition of the DOFs is not unique. There are many equivalent ways to choose a complete set of observables for the same system.
If an observable ${\hat A}$ can be expressed uniquely in terms of some complete set of commuting ${\hat O}_k$-s, or if each eigenstate of ${\hat A}$ can be expressed uniquely in terms of the common eigenstates of the ${\hat O}_k$-s, then ${\hat A}$ is completely described within the ${\mathcal H}$ of the ${\hat O}_k$-s. Otherwise, ${\hat A}$ is, or includes, a new DOF and we need to expand ${\mathcal H}$ to accommodate it.
For example, a 1D spinless particle has a single degree of freedom that can be represented by its position operator ${\hat X}$. Alternatively, we can choose to represent it by the momentum ${\hat P}$. But ${\hat P}$ still acts in the same Hilbert space as ${\hat X}$ because we know how to express any eigenstate of ${\hat P}$ in terms of the eigenstates of ${\hat X}$.
For a spin-1/2 1D particle, the spin cannot be expressed in terms of position, momentum, or any function of them. In fact the spin value can be defined independently of either position or momentum. Correspondingly, the eigenstates of the spin observable cannot be expressed in terms of eigenstates of ${\hat X}$ or ${\hat P}$ and this means that the spin is a new degree of freedom that must be accommodated by expanding ${\mathcal H}_X$.
Same works for extending the 1D particle to 2D. The values of the additional coordinate $Y$ can be defined independently of $X$ and the corresponding DOF must be accounted for separately in the total Hilbert space. In this case we can even establish an isomorphism between the eigenstates of observables ${\hat X}$ and ${\hat Y}$, but they still need to be accounted separately because the $X$ and $Y$ DOFs must have independent values.
Caution: The fact that 2 observables commute or not is not in itself sufficient to decide whether they represent independent degrees of freedom. For instance, ${\hat P}$ and ${\hat P}^2$ do commute, but they are not independent DOFs. On the other hand, if ${\hat \sigma}$ is the spin observable, ${\hat X}$ and ${\hat \sigma}{\hat P}$ do not commute, but may be considered as independent DOFs, while ${\hat P}$ and ${\hat \sigma}{\hat P}$ do commute and may also be considered as independent DOFs. The important distinction is, ${\hat P}^2$ can be completely described in terms of ${\hat P}$, but ${\hat \sigma}{\hat P}$ cannot.