How that isolation happens varies and can take a single generation or up to hundreds of thousands of years. A polyploid plant, for example, might become genetically isolated within a single generation or a homoploid hybrid within a few generations by losing reproductive compatibility with the rest of its species. Then a mutation might give it significant advantages without making it into the rest of the population or a “sudden” ecological change favors the new population over the old, giving the new one room to grow and outcompete.
Other species are isolated over “short” periods via flooding, rising mountains, changes in the paths of rivers, expansion of a predator’s range, fires, and so on. Anything that can isolate a small group of a species geographically can also create a speciation event.