Maximum temporary hit points is 1810
TheFiddlerWins' answer missed some things even at the time it was released. Again we use Blackrazor's Devour Soul feature (DMG 216) but we will also use the Potion of Giant Size magic item from Storm King's Thunder (236).
When it devours a soul, Blackrazor grants you temporary hit points equal to the slain's creature's hit point maximum.
Potion of Giant Size
For [24 hours if you are Medium or smaller], ... your hit point maximum is doubled
Since Potion of Giant Size can only affect Medium or smaller creatures we use a creature who is not the Tarrasque (who is larger than Medium... much larger...)
Ancient Gold Dragon
- Base hit points equal to 28d20 + 252. [Max: 812]
Manual of Bodily Health
- Increase Constitution to 30 (+10) for +1 hit point per Hit Die or +28. [Max: 840]
- Level 10 aid spell1
- Increases Maximum HP by 45. [Max: 885]
- Heroes' feast spell
- Increase Maximum HP by up to 20 [Max: 905]
- The dragon uses Change Shape becoming a Medium humanoid
- For the metallic dragons' Change Shape features, hit points are retained.
- Potion of Giant Size
- This doubles Maximum HP. [Max: 1810]
So simply finish off this dragon with Blackrazor and enjoy your 1810 Temporary Hit Points.
1: This is possible because of the Book of Exalted Deeds which says (credit to Ruse in the comments for mentioning this and heroes' feast):
Enlightened Magic. Once you’ve read and studied the book, any spell slot you expend to cast a cleric or paladin spell counts as a spell slot of one level higher.
Details on how this allows for tenth level spells can be found in these questions: