Sometime as one word means at an unspecified point — let's meet sometime. Some time as two words means a period of time — this will take some time. And sometimes, with the S, means occasionally. Three forms, three jobs.
The core difference
Three forms that are constantly interchanged.
- sometime — at an unspecified point: sometime next week.
- some time — a period: it took some time.
- sometimes — occasionally: sometimes I forget.
The test for the first two
Try inserting a word before time. "It took some considerable time" works, so it was two words — some is a quantifier describing an amount. "Let's meet some considerable time" does not work, so that was one word.
The adjective
Sometime also works as an adjective meaning former — a sometime colleague. That use is formal and now uncommon, and it is why the word occasionally appears where a reader does not expect it.