Brian Scott and joriki have already answered this comprehensively, so the purpose of this answer is to provide a direct counting perspective that lays bare some of the interesting connections between the harmonic number $H_{n}$ and a certain Stirling number of the first kind.
Let $X$ be the discrete random variable representing the number of cycles in a random permutation of $[n].$ Then $X \in \{1, 2, \ldots , n\}$ and $P[X =i] = \dfrac{c(n, i)}{n!}$, where $c(n, i)$ denotes the (unsigned) Stirling number of the first kind which counts the number of permutations on $[n]$ with exactly $i$ disjoint cycles.
Then $E[X] = \displaystyle\sum_{i=1}^{n}iP[X=i]= \dfrac{1}{n!}\displaystyle\sum_{i=1}^{n}i \,c(n, i)$
It so happens that the sum $\begin{equation}\displaystyle\sum_{i=1}^{n}i \,c(n, i) = c(n+1, 2) \tag{*}\label{*}\end{equation}$ by the following double-counting argument: the RHS by definition, counts the number of permutations on $[n+1]$ having $2$ cycles. (We can freely require that $n+1$ be written as the first element of the cycle.) But we can also count the elements of this set via the LHS too. Begin with a permutation on $[n]$ with $i$ cycles (written in cycle form) where $1\leq i \leq n.$ There is a choice of $i$ cycles for $n+1$ to join (and be the first element of) and define one cycle. Deleting all the internal brackets of the remaining cycles we obtain the other cycle. Summing over all possible numbers of cycles for a permutation on $[n]$ to have, we get the above identity.
So $E[X] = \dfrac{c(n+1, 2)}{n!} = H_{n}$, where the latter equality holds by yet another interpretation of $c(n+1, 2):$ Consider a permutation on $[n+1]$ with $2$ cycles and $n+1$ is the first element in a cycle of length $i$ where $1\leq i \leq n.$ Choose the $i-1$ elements to fill out that cycle in $\binom{n}{i-1}$ and arrange them in $(i-1)!$ ways and place the remaining $n-i+1$ elements in a cycle in $(n-i)!$ ways. Putting this together and summing over all possible lengths of the first cycle we get: $c(n+1, 2)=\displaystyle \sum_{i=1}^{n}\binom{n}{i-1}(i-1)!(n-i)! = \displaystyle n!\sum_{i=1}^{n}\dfrac{1}{n-i+1} = n! H_{n}$ after re-indexing, thereby completing the proof.
It's worth noting that equation $\eqref{*}$ is a special case corresponding to $k=1$ in the following identity: $$\displaystyle \sum_{i=k}^{n}\binom{i}{k}c(n, i) = c(n+1, k+1).$$
This can be proven by a similar double-counting argument.
Final remark: One advantage of using an approach like this is that we can get higher moments of $X$ without too much additional work, if $c(n, i)$ is known for small $i.$