To the plane of their deity; historically the Dragon Eyrie in Faerûn.
According to the D&D 5e Dungeon Master's Guide p.24, "Bringing Back the Dead", the general rule is that when a creature dies, its soul travels to the plane of its deity. Specific to Faerûn, 5e's Sword Coast Adventurer's Guide p.20 notes the human belief that souls first arrive at the Fugue Plane, where the worthy are selected and delivered to the domain of their deity.
Monster Manual p.83, "Dracolich", and p.86, "Dragons", assert that the dragons do indeed have gods, chiefly Tiamat, who lives in Avernus, and Bahamut (p.103), who lives in the Seven Heavens of Mount Celestia. There are various other draconic gods, and a dragon may occasionally worship some non-draconic deity.
According to the D&D 3.5 Draconomicon, p. 33, the draconic deity Chronepsis decides where dragon souls go:
Chronepsis is a passionless observer of the world. He passes judgement on all dragons when they die, deciding where their souls go in the afterlife.
In Faerûn, according to third edition sources, Chronepsis is considered an aspect of the deity Null, and along with the other draconic deities ruled from Dragon Eyrie, where the spirits of dragons ended up. According to Ed Greenwood, the Dragon Eyrie was destroyed in the Spellplague (the start of D&D 4e). It's not clear whether or not it was canonically restored in the 5e era.
Draconomicon p.15, notes that when a dragon reaches the end of its natural life, it often travels to a dragon graveyard to die, whereupon its soul departs (although this section doesn't specify where exactly they depart to):
A dragon can simply will its spirit to depart. Upon doing so, the dragon dies, and its spirit is released into the hereafter.
Some dragons remain as a ghostly guardian to protect the graveyard from looters and desecrators.
Alternatively, a dragon may simply transform into part of the local landscape, becoming a mountain, lake, grove or the like. Here, their spirit watches over future generations of dragons who inhabit the land.