Ultimately, you should think about a home transaction in two steps. First step is finding a home (or finding a buyer), and the second step is getting the transaction done, which usually means getting a mortgage (or waiting for the buyer to get a mortgage) and processing the paperwork.
When it comes to the first step, there are many variables including the available property ("inventory"), the specifics of the type of property you are looking for or selling, and the current condition of the market. All of that will impact your timeframe. In the US, on average, buyers will view 19 homes and spend 124 hours.
A good real estate agent will tell you what to expect in your city in current market conditions and help you along the process. Be up front with them about your expectations so that you can get clear advice and prepare accordingly. One good way to think about this is: The market favors those who have time on their hands. The longer you have, the better a deal you can get.
The second step of getting a mortgage also has several steps. This includes getting pre-approved, getting a home appraisal, and finally, getting the actual loan. On average, this process takes 30 days, but during high-volume months, it can take up to 60 days or even longer.
In other words: your timeline will vary, but expect to spend around 6 months on getting your next property.
Now… Hypothetically speaking: Let's say you are a buyer and you don't mind overpaying. You simply walk into an open house and offer to pay the asking price in cash, and the buyer accepts. Even in that case, you would still need to wait through the closing process. Without the mortgage approvals, you would still need to schedule the lawyers/notaries for the paperwork, which would, if we are being exceedingly optimistic, take at least 7 days. This way of buying without any inspection or due diligence would, of course, be a much higher risk and is not recommended!
Another word of caution: Real estate transactions can get quite complex. For instance, when buying a house, setting up an appointment with a lawyer may require having your mortgage approved first, which may require having insurance, which may require getting a valuation from an approved inspector, which may require getting survey paperwork from the city, which may require seller's notarized signature, which may require another appointment with a different lawyer, which may require waiting yet another week.
In other words, whether you're buying or selling, real estate transactions take time and energy, and you frequently find yourself dealing with red tape or waiting on others. A good Realtor will help you plan ahead and navigate all the bureaucracy. Especially if it's your first time buying property, a good Realtor can make a big difference. A bad one can cost you time, money, and have you miss out on deals.