The honest answer is that it depends on which of several very different tasks you actually mean, and the range runs from a few days to more than a year. Bundling them all under "SEO" is why the question gets such unsatisfying answers.
Here is the breakdown by how fast each part moves.
Days
Getting indexed at all. A new site submitted properly through Search Console typically starts appearing within days.
Fixing a block. If a noindex tag or a robots.txt rule was hiding your site, removing it and requesting a recrawl brings the pages back quickly.
Google Business Profile changes. Hours, categories, description and photographs update fast. Adding a profile where none existed can change your local visibility within a week, which makes it the highest-return work available to most local businesses.
Correcting information that is wrong. A changed phone number or address propagating to your profile and main listings.
Weeks
A new page ranking for something specific and uncontested. Write a genuinely useful page answering a narrow question and it can start appearing for that question within a few weeks. The narrower and less contested the question, the faster.
Technical improvements taking effect. Page speed, mobile layout, structure. These get recrawled and reassessed over weeks, not days.
Early movement on your own name and close variants.
Months
Service-plus-place searches with real competition. Three to six months is a fair expectation for meaningful movement, longer if established competitors are doing the same work.
Anything depending on accumulated reviews. Reviews arrive at the pace customers leave them, and attempts to accelerate this artificially are visible and risky.
A blog becoming a source of enquiries. Individual posts may rank quickly. The pattern where the blog reliably produces work takes many months of consistent, genuinely useful publishing.
Longer, or never
Broad national terms in competitive industries. Realistically out of reach for a small business, and not worth the budget it would consume.
Anything where the results are dominated by directories and marketplaces.
Ranking without changing anything. Some sites are structurally unable to rank -- built entirely as images, no readable text, no unique pages per service. No amount of ongoing work fixes that. The site has to change.
Why the timeline is not really about time
The variable that dominates is not months elapsed but whether the underlying work happened.
A business that publishes four genuinely useful pages in three months moves further than a business that pays a retainer for twelve months of "optimisation" with nothing new to show. Search engines are ranking pages. If no good pages appeared, there is nothing new to rank.
This is why the honest question to ask a prospective agency is not "how long" but "what will exist at the end of month three that does not exist now". If the answer is a report, that is not an answer.
The promises that mean walk away
Guaranteed first place. Nobody controls the results. Anyone guaranteeing a position either does not know that or is counting on you not knowing it.
A specific number of backlinks per month. Links bought by the batch come from networks that exist to sell links, which is the pattern most likely to do active harm.
Results in thirty days on competitive terms. The only things that move that fast are the free fixes listed at the top of this page, which you could do yourself.
Refusing to say what will actually be done. Vagueness about the work while being precise about the invoice is the clearest signal there is.
What to expect if it is being done properly
Month one is mostly diagnosis and the fast free fixes. Expect the profile sorted, the technical blocks cleared, and a plan naming specific pages.
Months two and three, pages start existing. You should be able to read them and recognise your own business in them.
Months four to six is where local searches start moving, if the pages are good and the profile is maintained.
Beyond that it compounds slowly, and the main risk becomes paying for maintenance of something that is finished. Reassess annually whether the ongoing work is producing anything, or whether the project should end and the budget move elsewhere.