A lot of people in the Bay Area got their 30y mortgages locked in at a fantastic (low) 3.x% in the last ~5y, and would be hesitant to give that up, even if they wanted to upgrade. Combined with with property taxes that are locked to inflation, means that a homeowner has an incentive not to sell, and buyers compete for limited inventory.
Five is pretty standard, but you can get longer if you want. RBC has seven year rates on their website, and if you ask you can get the full term of your mortgage. The rate is ridiculous though, for example, in April 2013 the RBC posted rate for a 25-year term was 8.75%. Obviously negotiable, but still a high starting point.
When I was financing our first home our mortgage broker said he only ever had one person get a 25-year term.
Source for the 25-year rate: http://business.financialpost.com/personal-finance/mortgages...
That said, fixed rate mortgages almost always cost you more in the long run, though a 5 year term is probably going to screw you less than a 25+ year term.