In my experience, for the most part, "המקום ינחם אתכם בתוך שאר אבלי ציון וירושלים" is said to a mourner specifically during shiv'a. However, I've heard some people say it after shiv'a, particularly the first time they speak to the mourner as a mourner. (Because I'm mostly unacquainted with that practice, I say something less formulaic if speaking to a mourner for the first time, e.g. "Hashem should give you nechama".) So my question is twofold:
- Does halacha (or the minhag of any communities) say anything about this? Specifically, is "Hamakom…" restricted to shiv'a? (Or do any halachic sources say explicitly that it's not?)
- (Especially if the answer to #1 is that halachic sources say nothing…) What's the convention? (This will depend on location, of course.)