$\DeclareMathOperator\GL{GL}$I think that there is probably too much variety in the examples to expect any clean classification. Consider the following examples:
First, as I mentioned in my comment, for any $\mathbb{R}$-subalgebra $S'\subset M_n(\mathbb{R})$, the invertible elements $S = S'\cap \GL(n,\mathbb{R})$ will satisfy $S=S^{-1}$. (If $S'$ has no invertible elements, this is trivial. If $s\in S'$ is invertible in $M_n(\mathbb{R})$, i.e., $\det(s)\ne0$, then by Cayley–Hamilton, $I_n$ is a polynomial in $s$ and hence $s^{-1}$ is a polynomial in $s$ and so lies in $S'$. Thus, $S^{-1}=S$. There is no simple classification of the subalgebras of $M_n(\mathbb{R})$ that contain $I_n$ (i.e., that have invertible elements).
Second, the subspace $\Sigma_n\subset M_n(\mathbb{R})$ consisting of the symmetric $n$-by-$n$ matrices has the property that its set of invertible elements is linear in the OP's sense. It's not a subalgebra of $M_n(\mathbb{R})$, though. More generally, if $S'\subset M_n(\mathbb{R})$ is a subspace that contains $I_n$ and is closed under positive powers, i.e., $s\in S'$ implies that $s^k\in S'$ for all $k\ge 1$, then $S = S'\cap M_n(\mathbb{R})$ is linear in the OP's sense. (The example of $\Sigma_n$ shows that such an $S'$ does not have to be a subalgebra.)
There are other examples that are not subalgebras. For example, when $n=4$, take $S'\subset M_n(\mathbb{R})$ to be the $3$-dimensional subspace of matrices of the form
$$
s = \begin{pmatrix} a & b & c & 0\\-b&a&0&-c\\-c&0&a&b\\0&c&-b&a\end{pmatrix} = a\,I_4 + b\,\mathbf{i} + c\,\mathbf{j},
$$
and note that $s^{-1} = \bigl(a\,I_4 - b\,\mathbf{i} - c\,\mathbf{j}\bigr)/(a^2+b^2+c^2)\in S'$ when $s\ne0$, but $S'$ is not a subalgebra of $M_4(\mathbb{R})$. (It generates the quaternion subalgebra spanned by $I_4,\mathbf{i},\mathbf{j},\mathbf{k} = \mathbf{i}\mathbf{j}$.)
For a more exotic example, let $\mathbb{O}\simeq\mathbb{R}^8$ denote the (non-associative) algebra of octonions. For $\mathbf{x}\in \mathbb{O}$, let $L_{\mathbf{x}}:\mathbb{O}\to\mathbb{O}$ be left multiplication by $\mathbf{x}$. Now let $S'\subset M_8(\mathbb{R})$ be the subspace of dimension $8$ spanned by $\{L_{\mathbf{x}}\ \vert\ \mathbf{x}\in \mathbb{O}\}$. Because the octonions are not associative, $S'$ is not a subalgebra of $M_8(\mathbb{R})$, in fact, it generates $M_8(\mathbb{R})$. Meanwhile, every nonzero element of $S'$ is invertible, and its inverse belongs to $S'$, so, setting $S = S'\cap \GL(8,\mathbb{R})$, one has $S^{-1} = S$.