As others have said it really is how long is a piece of string, based on:
The sums involved
The time involved
Your personal appetite for risk
I really value Scott Galloway's advice on wealth building and his advice is - don't try to look for the needle in the haystack, just buy the haystack.
That is, don't get sucked into trying to pick a stock or sector that you think is going to outperform - simply invest in basic tracker funds. These just track the average movement of the whole market. Over a decent period, they will deliver for you. There will always be outliers that do better than that average, but it's really little more than gambling to try to predict what those will be.
This is the best investment advice, I think. It isn't sexy or complicated but it's very sound.
The US economy is in a very good state at the moment, so I am putting my s&s ISA investments in US tracker funds.
There are also good rates on cash ISAs at the moment for the first time in ages, so I've got money in one of those fixed at 5.8% for a year.
My s&s ISA is currently only returning about 3.8%, but what's counterintuitive is that that isn't necessary a bad thing given I'm currently buying stocks and shares (rather than having an investment whose income I'm trying to live on). It's GOOD that they're cheap at the moment, because it means I'm not paying a lot for the stocks/shares that I invest in, but their value will grow. I'm seeing those investments as a 20 year thing.
LISAs are also a good way to get free money if you meet the criteria and don't mind eg not being able to access money until you're 60.