I assume it's a common writer's question. If you're writing from actual experience in any way, from events that happened to you, how long do you wait before you turn those experiences into narrative form? I'm talking about for fiction here, not, let's say, for journalism. With journalism, you might write something during an event or immediately after it, but for fiction, a certain amount of distance is good. You want to give yourself perspective on what you lived through. At the same time, you may not want to wait too long. Events recede; memories dim and what occurred becomes confused in your mind. Or you think about something for so long (or what's worse, discuss it too much) that you lose the desire to write about it. There has to be something to explore when you write, but if you've gone over your subject in your head to the point where there's nothing left to explore, then why continue to bother with it? It's something that's become uninteresting even to you.
Now it goes without saying that it depends what kind of experiences we're talking about. Some things we live through, with the depth of the pain they've caused or the grief they've stirred or even the happiness they brought, never become uninteresting to us. But I wonder (and again, it depends on the kind of experiences we're talking about), what does perspective mean? If you were angry over something once, do you calm down with the passing of time so you can write with a sense of relative tranquillity? If you were bitter, does an interval of years temper that? How about sadness? If time doesn't wipe it away, it may at least mute it and improve the chances of producing a work that hits a number of emotional registers.
How distance from events affects a person depends, naturally, on the person. And since writers are people (last time I checked), the same differences go for writers. Some people may get angrier about something over time, or never shed an overwhelming feeling of melancholy, depression. Perspective, so-called, may not change anything for certain writers. I find for me that it does, and I tend to follow the general rule that says to let some time go by when planning to write from my own experience. The delay means I won't be too close to the events. By some time, I mean years, but I'm wondering if that's not too long. The farther I get from most things, the more I feel inclined to write about them comedically, because what once seemed important or maddening, or worthy of my passion, seems, in retrospect, to hold an element of the ridiculous. I shake my head and smile at what I once found infuriating. I also see that people I may have been at odds with could have had reasons for what they did that have a touch of merit. They may have been misguided, of course, but over time I've come to better understand their point of view.
So yes, distance is essential. At least, I think it is. But it's curious to think about how what you write, the tone you adopt, has a lot to do with your personality and how it relates to the passing of time.