Long

  1. We’ve been friends a long time.
    1a. We’ve been friends for a long time
  2. Have you been waiting long?
    2a. Have you been waiting for long?
  3. I haven’t been here a long time.
    3a. I haven’t been here for a long time.
    Are these sentences OK?
    Does #1 mean #1a?, similarly #2 & 2a, and #3 & 3a?

They are all correct.

#1 is the same as #1a
#2 is the same as #2a

#3 means only a short time has passed since the person arrived at the place. - I haven’t been here a long time; I just arrived 5 minutes ago.

#3a means a long time has passed since the previous time the person was at the place. - I haven’t been here for a long time; the last time I visited was 5 years ago.

Sorry, those explanations don’t sound too clear! Maybe the examples are better.