Well, I sent my first piece of fiction out with a query at the age of 17 and that was 39 years ago.
I didn't write a novel length work until I was 38. I queried it, but it (rightly) never went anywhere. Wrote the second novel at the age of 39, found an agent for it a few days after turning 40 and about three months into my querying process, and she sold it at auction three weeks after she first sent it out. So based on that you could say it took me 23 years from first send-out to published (for fiction--I had a lot of nonfiction stuff published starting at age 38). But for novel length works alone, it was two years and two novels.
I never have gotten any of my short fiction published, so for that it's been 39 years and counting, though I haven't submitted anything in years. I guess I do better writing long.
Beth