Depends on how much power you need and your access to sun. I'm in the Bay Area, installed solar panels about 18 months ago. Break even for the panels is estimated to be about 6 years at current market rates. Now I also had to do a new roof, which roughly doubles the break even time, ignoring the fact that I'd have needed a new roof anyways.
Currently I'm not taking into consideration decreased efficiency because the panels are warrantied for 90.08%+ at 25 years. Also something not taken into account on breakeven/cash positive is the fact that PG&E rates are always on the rise. As of March of this year rates went up 9%. The more rates go up, the faster I break even.