For me the sweet spots for joining are are:
* inception: this is any point at which the whole company can fit around a board room table. The environment is intimate and people are passionate and engaged.
* Post-IPO: as in, immediately post-IPO. This is the calm after the storm as, immediately pre-IPO, there will be a focus on pure profit and growth of value without growth of business, which means a lot of crunch and a lot of burnout. This does mean likely not getting the kind of stock offering that they might have given previously.
For jumping ship:
* Pre and/or post merger: mergers are horrible and lead to similar behaviours as IPO but with headcount reductions, culture clashes, and lots of wife reaching decisions without consultation. You'll also see an exodus of colleagues at both ends.
* Pre-IPO: if you've already banked your shares, don't stay to tighten the purse strings and burn out, similar to my comments on post-IPO.
A tl;dr would be: I like working at a company when the focus is on growth rather than profits because that's when people are working most to create new things and please customers.