This is not easy for general $G$, but we can immediately produce some crude bounds (on the minimal number $\mu(G)$ such that $G$ embeds into $S_{\mu(G)}$):
If we have an embedding $G \hookrightarrow S_n$, we must trivially have $|G| \leq |S_n| = n!$. Of course, this is sharp in the sense that equality holds for $G = S_n$. On the other hand, the regular representation of $G$ determines an embedding $G \hookrightarrow S_{|G|}$, so $\mu(G) \leq |G|$. This latter bound is sharp:
Theorem If $G$ is a group for which there is no embedding $G \hookrightarrow S_n$ for any $n < |G|$, then $G$ is
- a cyclic group $\Bbb Z_{p^m}$ of prime power order,
- a generalized quaternion $2$-group, or
- the Klein 4-group $\Bbb Z_2 \times \Bbb Z_2$.
There are numerous results available for certain classes of $G$. For example, if $\gcd(|G_1|, |G_2|) = 1$, then $\mu(G_1 \times G_2) = \mu(G_1) + \mu(G_2)$.This and (1) above together resolve the problem for abelian groups:
Theorem If $G$ is abelian, so that we can write it as $\Bbb Z_{a_1} \times \cdots \times \Bbb Z_{a_r}$ for (nontrivial) prime powers $a_1, \ldots, a_r$, then $$\mu(G) = a_1 + \cdots + a_r .$$
(Both of the Theorems here are given by D.L. Johnson and recorded in the reference below, which itself contains a bibliography of this topic.)
The realization of $D_8$ as the group of symmetries of the square determines an embedding $D_8 \hookrightarrow S_4$, and it's not too hard to prove that $\mu(D_{2n}) = \mu(\Bbb Z_n)$ and $\mu(A_n) = n$ (both for $n > 2$). These facts together determine $\mu(G)$ for all $G$ of order $<16$ except $Q_8$ and $Q_{12} \cong \Bbb Z_3 \rtimes \Bbb Z_4$:
- $S_1$: $\{ e \}$
- $S_2$: $\Bbb Z_2$
- $S_3$: $\Bbb Z_3$, $S_3$
- $S_4$: $\Bbb Z_4$, $\Bbb Z_2 \times \Bbb Z_2$, $D_8$, $A_4$
- $S_5$: $\Bbb Z_5$, $\Bbb Z_6$, $D_{10}$, $D_{12}$
- $S_6$: $\Bbb Z_4 \times \Bbb Z_2$, $\Bbb Z_2 \times \Bbb Z_2 \times \Bbb Z_2$, $\Bbb Z_3 \times \Bbb Z_3$
- $S_7$: $\Bbb Z_7$, $\Bbb Z_{10}$, $\Bbb Z_{12}$, $D_{14}$
- $S_8$: $\Bbb Z_8$, $\Bbb Z_6 \times \Bbb Z_2$, $\Bbb Z_{15}$
- $S_9$: $\Bbb Z_9$, $\Bbb Z_{14}$
- $S_{11}$: $\Bbb Z_{11}$
- $S_{13}$: $\Bbb Z_{13}$
An answer to this question gives an explicit proof that $\mu(Q_8) = 8$.
Lemieux, Stephane R., Minimal degree of faithful permutation representations of finite groups. (1999) Master's thesis.