Regardless if you want to rent or buy, the housing market in Silicon Valley is crazy. Over the last couple of years, house prices have increased not only back to where they were before the recession but even higher. Latest update from the local realtor mentioned days on the market with mainly one digit - the house is sold within a week after it goes on the market. The number of people who would love not to commute from far away gives a natural demand and as jobs are up and traffic is up and in spite of new apartment buildings in both San Francisco and all down the Peninsula, the demand for housing is way above supply.
If you are transferring into the valley on a company assignment, ask the company to help you with this so you at least have a landing pad to start out from. Make sure that you negotiate your contract to reflect the local renting costs. Many young people start their local presence by renting one bedroom in a house shared with likeminded people. Such rooms are typically offered at Craigslist.
There are many 2-3 story apartment buildings where you may not only have an easier time getting to know local Americans but you may also have access to swimming pools or work out studios on the premises. Newer higher buildings are showing up all over the area. While they are nice with their brand new interiors, the rent is easily in the $4000/month and up range for a two bedroom apartment.
If you want to buy a house, the first challenge is credit rating. And all other things equal, you will be offered a better interest rate if you have a green card than if you are on a less permanent visum.
Next step is to get a real estate agent. Normally both seller and buyer has their own agent - preferably not from the same company. Both agents are paid from the 6% fee that is taken out of the final sales price. Some sellers don't have an agent but they still have to pay your agent, so technically you may save 3% on the price if you can negotiate directly with the seller. But the stack of papers required is huge and there are many traps.
Your agent will recommend that you hire your own building inspector to check if the ducts are insulated and connected, the pipes holds water pressure, the roof is in good condition, the water heater strapped against earthquakes, the wires grounded, the toilets correctly mounted, the house free of termites, and in general in the condition claimed in seller's reports. Perhaps you make you offer conditioned on certain shortcomings being fixed; perhaps the house will go to somebody with an offer without such conditions...
If you buy an older house you may consider a "Homebuyers Protection" insurance that will cover most appliances and piping problems.
Compared to the rest of the country houses on the Peninsula are very expensive. You can get twice the house in the East Bay, four times the property if you move just about anywhere else in the US (save a few selected spots like Manhattan or Hollywood.) But if you bring children you may want to check out the school ratings before you sign any contracts. What you may save in mortgage you may have to pay in private school tuition. Real estate agents point out that three parameters determine the house prices: Location, location, and location.