I know that the cross product only exists in $\mathbb{R}^3$ and $\mathbb{R}^7$ but I am wondering what the actual definition of cross product is. That is, a cross product would be a function
$$f:\mathbb{R}^n\times \mathbb{R}^n \to \mathbb{R}^n$$
but what properties would it have to satisfy to be called a cross product?
To my knowledge, a cross product is a binary operation that gives a vector (unique up to nonzero scalar multiplication) orthogonal to the inputs. As you noted, such an operation is only defined for $\mathbb R^3$ and $\mathbb R^7$.
There is a way to find a vector (unique up to nonzero scalar multiplication) of $n-1$ vectors in $\mathbb R^n$, called the external product of the vectors and is defined by $$\mathbf v_1 \wedge \cdots \wedge \mathbf v_{n-1} = \det \begin{pmatrix} \mathbf e_1 & \cdots & \mathbf e_{n-1} \\ \mathbf v_1^1 & \cdots & \mathbf v_{n-1}^1 \\ \vdots & \ddots & \vdots \\ \mathbf v_1^{n-1} & \cdots & \mathbf v_{n-1}^{n-1} \end{pmatrix}. $$