How many distinct subgroups does the symmetric group $S_3$ have?

I think that for small groups like $S_3$ this not very difficult to do by hand.

$S_3=\{id,(12),(13),(23),(123),(132)\}$

Clearly, $\{id\}$ and $S_3$ are subgroups of $S_3$

Now let us have a look at subgroups generated by one elements (cyclic subgroups). (We only have 6 elements to try, and we have already considered $[id]=\{id\}$.)
$[(12)]=\{id,(12)\}$
$[(13)]=\{id,(13)\}$
$[(23)]=\{id,(23)\}$
$[(123)]=[(132)]=\{id,(123),(132)\}$

Is this list of all subgroups? Yes, it is.

We can do this by trial and error -- trying adding one element to subgroup from our list and checking whether they generate the whole group $S_3$. (Which seems tedious, but in fact we only have to check whether any subgroup containing at least one 2-cycle and at least one 3-cycle is the whole $S_3$; and also observe that two different 2-cycles give us a 3-cycle.)

But quicker way is to notice that any proper subgroup of $S_3$ must have 1, 2 or 3 elements. (Order of subgroup must divide order of the group.) And any group of prime order is cyclic. So by enumerating cyclic subgroups we have obtain list of all proper subgroups of $S_3$.

We can check our result at groupprops wiki (or elsewhere): Subgroup structure of symmetric group:S3.

You also asked about $S_4$. As I have mentioned in my comment, there is another question on this site about subgroups of $S_4$: How to enumerate subgroups of each order of $S_4$ by hand


An important theorem to use is that the order of any subgroup must divide the order of $S_3$. Now, the order of $S_3$ is just 3! = 6. Hence, any candidate subgroup must have order 6, 3, 2, or 1. Note that the group of order 1 is just the trivial subgroup { e }, the group containing the identity element of $S_3$. Now, this is the only subgroup of order 1. The subgroup of order 6 must be $S_3$ itself, the only possible subgroup of order 6. Hence, we are left with subgroups of order 2 or order 3.

Subgroups of order 2: Note any subgroup must contain the identity element e. Hence, we are interested in sets of the form K = { e $\in $ K and |K| = 2 and s $\in$ S$_3$, such that s$\circ$s=e }. This is because we want closure and we need an identity and inverse for any subgroup. It is not difficult to check that the only elements in $S_3$ satisfying the conditions on K are the transpositions on $S_3$.

Subgroups of order 3: For subgroups of order three we are interested in sets of the form F = { e $\in$ F and |F| = 3, and $s_1$,$s_2$ $\in$ S$_3$ such that $s_1$$\circ$$s_2$=$s_2$$\circ$$s_1$= e }. This is because we want to make sure our set is closed, and contains inverses and the identity. It is not difficult to check that there are only two elements in $S_3$ with unique inverses (inverses that are not the element itself) that satisfy all of the conditions imposed on F.

So you are done, and the number of unique subgroups of $S_3$ is 6.