In simple words, in American English verb conjugation for "get" goes: get, got, gotten. "Got" is the past tense, and "gotten" is the past participle.
In British English, "gotten" has gotten (become) a bit dated and is no longer used as the past participle of "get". So the list goes: get, got, got.
In your example, if you follow the American English tradition you would say "a friend whom I had gotten along with", and if you follow the British English tradition it is "a friend whom I had got along with", because "get alone with someone" is a set phrase and here you need the past participle following "have/had".
However, things get a little tricky if you talk about "have got something" in American English. "Got" is also used in American English in the phrase "have got" or it's contraction "'ve got". I won't get into that since that is not what you are asking. Read these posts:
Should I use “got” or “gotten” in the following sentence?
These discussions might be a little hard to follow. All you need to remember is "have got" is a unique phrase and a set usage. And it means the same as "have" (possession).
Look what I've got here. (or more casually Look what I got here.)
= Look what I have here.
Your example is not an instance of "have got" and has nothing to do with "have something". It is "have" + "get along with". In this case you need to conjugate "get" and use its past participle. That is why you say "a friend I had gotten along with" (if you follow American English). That is because "get along with someone" is another phrase in its own right.