As Manxx mentions above, there's the difference between "investing" and "trading" to be considered. Both forex and stocks can be dealt in as either trading or investing, but the reality is that more people dealing in forex are trading while more people dealing in stocks are investing, and since trading is seen as riskier than investing (and given the way so many people approach trading, that's probably valid), that accounts for part of the perception.
However, comparing the two just on a trading basis, I don't believe that trading forex in itself is any more risky than trading stocks. I think a lot of the reason it's perceived as riskier has to do with the behaviour of its market participants.
Forex, because of its ready accessibility, high leverage availability, ability to be traded with minimal capital, widespread promotion and marketing, and so on, attracts more than its share of newbies with unrealistic expectations and/or a gambling mentality, and there's a whole very successful industry out there (and some of it "in here" as well, unfortunately) whose own business model is predicated on attracting people who will steadily lose most or all of their money.
For these reasons there's a widespread perception that it's "the fact that it's forex" that carries the risk.