What you need is the corollary on the bottom of page 60 of Bourbaki, Algèbre, chapitre V : Corps commutatifs ; section 10 (Extensions galoisiennes), subsection 4 (Descente galoisienne).
The statement given there is more precise: given an $L$-subspace $W$ of $L^n$ which is stable under Galois, the $K$-subspace $V=W\cap K^n$ of $K^n$ satisfies $W=V\otimes_K L$ and is the unique one with this property. Since dimension is preserved by base change, one has $\dim_L(W)=\dim_K(V)$, as you requested.