The honest answer is: it depends what you mean by "learn to sail." If you mean getting on a boat without panicking, a few hours. If you mean confidently skippering a 40-foot catamaran across open water, longer. But the gap between those two things is smaller than most people think — especially if you choose the right learning environment.
I've been sailing for years, and I've watched the moment click for a lot of students — sometimes on day one, sometimes on day three, almost always within a week of living aboard. Here's what the actual timeline looks like.