In sentences like "It hasn't happened in/for a long time" and "It was our first meeting in/for a long time", there isn't any difference. In sentences like "It lasted for a long time" and "He's been around for a long time", only "for" is possible.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.