This was basically answered in the comments, but to summarize: the answer is $\boxed{ k = \frac{n}{2} }$.
This can be done using either the Cartan-Dieudonné theorem (for a proof see here), which lets you write every element $g \in O(n)$ as a product of at most $n$ hyperplane reflections (if $g \in SO(n)$ then there are an even number of these and you can pair them up to get at most $\frac{n}{2}$ plane rotations, not necessarily orthogonal), or using the spectral theorem, which tells you that every element of $O(n)$ has an orthonormal basis of eigenvectors over $\mathbb{C}$, whose eigenvalues are complex numbers on the unit circle which come in complex conjugate pairs. Given such a complex conjugate pair $\lambda, \overline{\lambda}$ with complex conjugate eigenvectors $v, \overline{v}$, $g$ acts by a rotation by $\text{arg}(\lambda)$ on the plane spanned by $\text{Re}(v), \text{Im}(v)$, so the spectral theorem writes $g$ as a direct sum (hence product) of $\frac{n}{2}$ plane rotations, which are now orthogonal.
A product of $k < \frac{n}{2}$ plane rotations, orthogonal or otherwise, necessarily fixes a subspace of dimension at least $n - 2k$ (namely the orthogonal complement of the sum of the planes of the rotations), but in the general case $g \in O(n)$ does not have a fixed subspace at all. So $k = \frac{n}{2}$ is best possible in general, and is the generic case.
The spectral theorem reduces the algorithmic problem to finding eigenvectors, but I think there is an algorithmic proof of the Cartan-Dieudonne theorem that is even simpler than this and doesn't require even the concept of an eigenvector.