The number of degenerate orbitals in a subshell is determined by the number of possible values for the magnetic quantum number, $m_l$. For a given value of the azimuthal quantum number, $l$, the magnetic quantum number $m_l$ can take on values from $-l$ to $+l$, including 0.
That is, $m_l = -l, -l+1, ..., 0, ..., l-1, l$.
The total number of possible $m_l$ values (and thus degenerate orbitals) is $2l + 1$. For a $d$ subshell, the azimuthal quantum number $l = 2$. Therefore, the number of degenerate orbitals is: $2l + 1 = 2(2) + 1 = 4 + 1 = 5$
Therefore, the number of degenerate orbitals in a 4d subshell is 5.