There are a number of elements to buying a home.
1) You need to get yourself financially ready to purchase. If you have saved up a downpayment, you should go get a pre-approval from a loan officer at a bank. This should take about 2-3 weeks. Until you know what you can get approved for, you won't have a realistic budget to work with.
2) Assess what you need in a home and get familiar with what's available. This is a highly variable period of time. Some people can narrow that down in a few weeks, while others may take 6 months.
3) Find a real estate broker who will educate you as well as protect your interests in the purchase process. If you have some good referrals, this should be pretty quick.
4) Visit prospective homes and make some offers. This is also a highly variable period. Lucky buyers can win deals in the first week and others can drop dozens of offers over a year before winning a deal. A good real estate broker can help limit the time needed with good guidance.
5) The actual close is pretty straightforward. A short sale will add about 2-3 months to the process. Once in escrow, it's about 30-45 days on average to close.
So, altogether, I've seen first-time home buyers I've worked with go from thinking about buying to getting the keys to their home sometimes in as quick as 3 months and others up to over 2 years (they're still looking for a "steal").