D&D 5th edition leaves this up to the DM.
In earlier editions of Dungeons & Dragons, it was indeed possible for a mortal to ascend to divine status. Vecna of the World of Greyhawk is perhaps the best known example, and the Forgotten Realms has at least twenty.
D&D 5th edition does not define the requirements for divine ascension. The Dungeon Master's Guide very much leaves it up to the DM to decide how their world's deity system works. Particular suggestions in that book:
- On page 11, the Divine Rank sidebar includes quasi-deities as the weakest category, but omits ascended humans from that category.
- Page 13, under Forces and Philosophies, suggests that in some settings a deity is much less powerful entity than usual, but that humans can become deities in that setting.
- Page 38 notes that a 20th level cleric may ascend to the right hand of their deity, although this is ambiguous as to whether they become a deity.
- Page 94 lists "Ascend to godhood" as a possible objective of a campaign villain, suggesting that it is possible. The fact that this is a villain's goal suggests that doing so may be harmful to the world.
Lore from earlier editions gives more detail
In earlier editions of D&D, in its various campaign settings, ascension to divinity was specifically possible, and much more specific information was given about the process. This isn't official D&D 5e game rules, but it can be used as a guideline for DMs inventing their own system. In particular, if you can locate a copy of the D&D 3e version of Deities and Demigods, it contains a much more detailed exploration of divinity than the 5e DMG.
- Who would do it: This varies. Some were granted ascension by a deity: in the Forgotten Realms, Azuth ascended with the help of the greater deity Mystra. Raxivort ascended on his own by using an ancient artifact, without the help of any deity. Zagyg ascended by trapping several deities in a dungeon and siphoning out part of their divinity for himself. Other deities stole divine power by killing an existing deity. Deities and Demigods p.218-223 suggests that there can be any number of secret ways to ascend, and that the gods can create new ways or grant part of their own divinity to a mortal.
- Divine rank: Zagyg held the rank of Demigod. Kiaransalee was initially made a demigod. Greyhawk has several ascended humans with the rank of hero deity, a category of quasi-deity weaker than a demigod. Kyuss, an ascended human, held the rank of quasi-deity bordering between hero-deity and demigod.
- Original body: This may vary. Vecna's body disappeared upon ascension, suggesting that he took it with him when he ascended. He left behind his hand and eye, but those were cut off before he ascended (and his ascended form is still missing those parts). The AD&D 2e adventure Die Vecna Die! suggests that Vecna's current body isn't his original body, but that's probably a special case since Vecna was a lich and could normally survive losing his body.
- Followers: You don't need followers to be a deity, but Forgotten Realms lore suggests that gaining more followers increases your divine rank, with Kiaransalee rising from demigod to lesser deity upon gaining followers. Deities and Demigods suggests that a demigod has at least a few hundred followers or so, while the lower-ranked hero deity may have only a few or none at all. Kyuss could be weakened from demigod to hero-deity simply by inspiring confidence in townsfolk who feared his return, thus reducing the number of people who feared him.
- Entering a pantheon: Several ascended mortal deities entered pantheons as servants of other deities. Zagyg is servant of Boccob, while Kiaransalee was made a servant of Lolth against her will.