The general principle here is that if something has a period of $T$, it repeats itself every $T$. That means it also repeats itself every $2T$, as well as every $3T$, and so on.
If you have two functions $f$ and $g$ with different fundamental periods, and you want to know if some combination of $f$ and $g$—some function of them, in other words—is also periodic, what you want to do is see if there is some single value that is a multiple of both of those periods.
In this case, with the periods being $2\pi$ and $3\pi$, there is a common multiple of both of those. In fact, there are an infinity of them (as there must be), but the lowest (positive) one is $6\pi$. It does not matter that $6\pi$ itself is irrational; what matters is that it is an integer multiple of the two original periods: It is $3 \times 2\pi$, and it is $2 \times 3\pi$.
We can see this more directly as follows:
- $f$ repeats every $2\pi$, so it also repeats every $4\pi$, and also every $\fbox{$6\pi$}$.
- $g$ repeats every $3\pi$, so it also repeats every $\fbox{$6\pi$}$.
LStU's answer shows how to demonstrate this more rigorously. The above is just the intuition for finding the right period to try out.