When?
Anytime usually. I'm afraid saying that it's best to write when I'm not around anyone isn't accurate. When I'm around no one, I tend to relax completely, fall asleep, or do something silly like talk to people on Facebook or come here to Gaia and post. DON'T JUDGE ME!!! lol Truth be told, inspiration smacks me in the face most when I am quiet and focused (and I'll usually freak out and scramble for a pen and paper (pen because pencils break when I get into those wild, willy-nilly moments) and scare the crap out of any kids/parents nearby which causes me to laugh hysterically; I'm not kidding. Sometimes I scare myself.)
Where?
I could say anywhere, but the truth is, I can't stand having so much noise in the background while I'm trying to focus. I can do it, but I would prefer a quiet place like a library, my desk (when no one's in the house at the time) my bed (which is sometimes commandeered by my oh-so-annoying brother) or something along those lines.
It's not to say that when and where affect my best working potential. It's my state of mind, the ebb, flow, and balance of rational and irrational thought which drives my working habits (or pulls me over onto the side of the road to upchuck whatever I deem important enough to write down after a full day of activity).