Arial Black
Adventurer
Per the Temp HP rules in the PHB, temp HP never stack. When you get new ones, you have to decide if you want to keep your current Temp HP, or replace them with the new Temp HP.
If you replace the Temp HP from Armor of Agathys with those from another source, the spell ends.
If you want to get more use out of Armor of Agathys, you need to look into ways of mitigating the damage so that you lose the temp HP at a slower rate.
Methods I've used: 1st level is fighter for heavy armor and then take the Heavy Armor Master feat for DR 3/magic, judicious use of the Blade Ward cantrip (lasts until the end of your next turn), be a goliath (Stone's Endurance to reduce damage by 1d12+con every short rest), at higher levels Investiture of Stone for Resistance to non-magical B/P/S damage.
If you can team up with a 6th level+ abjuration wizard they can reduce damage on you. A lore bard can use Cutting Words to reduce the damage on a hit, etc.
Another way is Rage, for the resistance to damage.
My current PC is built around armour of agathys. Bar 2/War 5 (started with Bar 1, then got 5 levels of warlock up to Bar 1/War 5, then I'll go 2 more barbarian for Bar 3/War 5, and then warlock all the way to Bar 3/War 17), Fiendish bladepact.
Right now I cast one pre-asskicking fireball, Rage as a bonus action, then move through the enemies hoping they take their opportunity attacks!
Let's say each attack hits (and in later rounds I'll be Reckless Attacking so that they will be more likely to hit me!) and does 7 damage. I'll take half, round down, for 3 damage. They will take 15 cold damage each time! Waht a trade-off! When the spell's THP wear out then I'll soon get more THP from my fiend pact, which also last longer because of Rage/resistance. One hour's rest later, I cast AofA again!
If my AofA has 1 THP left and I earn 7 THP from my fiend pact for killing a foe, then I'll keep the 1 THP thank you very much! The next time I get hit I would rather have 1 THP and deal 15 cold damage than 7 THP and no cold damage. If AofA runs out, more THP is just a goblin away!