Introduction
Although it is not explicitly stated why Maedhros committed suicide, and he is the only Elf who is stated to have done so, there are several factors that may have led him to this end:
He could no longer fulfill the Oath of Fëanor
He could no longer avenge his father
He had nowhere to go
The combined effects of these, and his history in Middle-earth up to that point, would pretty much have left him with no other options except the one Maglor took (to wander Middle-earth forgotten/lost forever, which was more in Maglor's character)
The Oath of Fëanor
He was sick from the Oath:
Then Eönwë as herald of the Elder King summoned the Elves of Beleriand to depart from Middle-earth. But Maedhros and Maglor would not hearken, and they prepared, though now with weariness and loathing, to attempt in despair the fulfilment of their oath.
"Of the Voyage of Eärendil and the War of Wrath"
He could no longer fulfill the Oath since Eärendil had one of the Silmarils and he could not recover it:
Now when first Vingilot was set to sail in the seas of heaven, it rose unlocked for, glittering and bright; and the people of Middle-earth beheld it from afar and wondered, and they took it for a sign, and called it Gil-Estel, the Star of High Hope. And when this new star was seen at evening, Maedhros spoke to Maglor his brother, and he said: 'Surely that is a Silmaril that shines now in the West?'
And Maglor answered: 'If it be truly the Silmaril which we saw cast into the sea that rises again by the power of the Valar, then let us be glad; for its glory is seen now by many, and is yet secure from all evil.' Then the Elves looked up, and despaired no longer; but Morgoth was filled with doubt.
"Of the Voyage of Eärendil and the War of Wrath"
Neither he nor his brother could keep the Silmarils that they had:
But the jewel burned the hand of Maedhros in pain unbearable; and he perceived that it was as Eönwë had said, and that his right thereto had become void, and that the oath was vain.
"Of the Voyage of Eärendil and the War of Wrath"
Vengeance for his father
- Maedhros' father, Fëanor, had been slain by the servants of Morgoth (primarily Gothmog) just outside Angband. After the events of the War of Wrath, Morgoth and his servants were apparently defeated, and Gothmog had died at Gondolin years before (slain by Ecthelion). There was no one left to fight for someone who had spent the previous 500-odd years doing nothing but fighting.
Nowhere to go
After the War of Wrath, the situation he found himself in was thus:
Beleriand had pretty much been destroyed.
He was not sure if he could actually return to Aman, if he would have to renounce the Oath (which he perhaps would/could not do) and what future he would face there:
But Maedhros answered that if they returned to Aman but the favour of the Valar were withheld from them, then their oath would still remain, but its fulfilment be beyond all hope; and he said: 'Who can tell to what dreadful doom we shall come, if we disobey the Powers in their own land, or purpose ever to bring war again into their holy realm?'
"Of the Voyage of Eärendil and the War of Wrath"
The primary Elves left in Middle-earth were Galadriel, Celeborn, Círdan, Gil-galad and Elrond, all of whom had no love lost for Maedhros/the sons of Fëanor and thus he probably would not have been welcome at what would become Lindon, Eregion, Lothlórien, or Imladris.
Galadriel had disliked and distrusted Fëanor from the very beginning and had never liked the sons of Fëanor throughout the First Age. She would also have reason to dislike them for the attack on Doriath and then later the attack on the Havens of Sirion since she had a close connection to both of those places and the people that lived there.
Círdan was a Teleri, many of whom were slain by Maedhros and the sons of Fëanor during the Kinslaying, and they had opposed each other when Círdan and Gil-galad had come to the aid, too late, to the people at the Havens of Sirion.
Gil-galad was the son or Orodreth. Like Círdan he had opposed Maedhros during the attack on the Havens of Sirion. In addition, the sons of Fëanor were not popular in Nargothrond (where Gil-galad was probably born and raised as the son of the Lord of Nargothrond, Orodreth) due to the actions of Celegorm and Curufin. The brothers had conspired to ensure that when Felagund left Nargothrond to help Beren in his quest for a Silmaril, that he did so on his own,
Then King Felagund spoke before his people, recalling the deeds of Barahir, and his vow and he declared that it was laid upon him to aid the son of Barahir in his need, and he sought the help of his chieftains. Then Celegorm arose amid the throng, and drawing his sword he cried: 'Be he friend or foe, whether demon of Morgoth, of Elf, or child of Men, or any other living thing in Arda, neither law, nor love, nor league of hell, nor might of the Valar, nor any power of wizardry, shall defend him from the pursuing hate of Fëanor's sons, if he take or find a Silmaril and keep it. For the Silmarils we alone claim, until the world ends.'
Many other words he spoke, as potent as were long before in Tirion the words of his father that first inflamed the Noldor to rebellion. And after Celegorm Curufin spoke, more softly but with no less power, conjuring in the minds of the Elves a vision of war and the ruin of Nargothrond. So great a fear did he set in their hearts that never after until the time of Túrin would any Elf of that realm go into open battle; but with stealth and ambush, with wizardry and venomed dart, they pursued all strangers, forgetting the bonds of kinship. Thus they fell from the valour and freedom of the Elves of old, and their land was darkened.
And now they murmured that Finarfin's son was not as a Vala to command them, and they turned their faces from him. But the curse of Mandos came upon the brothers, and dark thoughts arose in their hearts, thinking to send forth Felagund alone to his death, and to usurp, it might be, the throne of Nargothrond; for they were of the eldest line of the princes of the Noldor.
And Felagund seeing that he was forsaken took from his head the silver crown of Nargothrond and cast it at his feet, saying: 'Your oaths of faith to me you may break, but I must hold my bond. Yet if there be any on whom the shadow of out curse has not yet fallen, I should find at least a few to follow me, and should not go hence as a beggar that is thrust from the gates.' There were ten that stood by him; and the chief of them, who was named Edrahil, stooping lifted the crown and asked that it be given to a steward until Felagund's return. 'for you remain my king, and theirs,' he said, 'whatever betide.'
Then Felagund gave the crown of Nargothrond to Orodreth his brother to govern in his stead; and Celegorm and Curufin said nothing, but they smiled and went from the halls.
"Of Beren and Lúthien"
This lack of support contributed to his death. The people of Nargothrond learned of this and turned on the brothers and expelled them:
There was tumult in Nargothrond. For thither now returned many Elves that had been prisoners in the isle of Sauron; and a clamour arose that no words of Celegorm could still. They lamented bitterly the fall of Felagund their king, saying that a maiden had dared that which the sons of Fëanor had not dared to do; but many perceived that it was treachery rather than fear that had guided Celegorm and Curufin. Therefore the hearts of the people of Nargothrond were released from their dominion, and turned again to the house of Finarfin; and they obeyed Orodreth. But he would not suffer them to slay the brothers, as some desired, for the spilling of kindred blood by kin would bind the curse of Mandos more closely upon them all. Yet neither bread nor rest would he grant to Celegorm and Curufin within his realm, and he [Orodreth] swore that there should be little love between Nargothrond and the sons of Fëanor there after.
"Of Beren and Lúthien"
Elrond and his brother Elros had been kidnapped by Maedhros and Maglor after the attack on the Havens of Sirion, and whereas Maglor was said to have been kind to them, there is no mention that Maedhros had been:
For Maglor took pity upon Elros and Elrond, and he cherished them, and love grew after between them, as little might be thought; but Maglor's heart was sick and weary with the burden of the dreadful oath.
"Of the Voyage of Eärendil and the War of Wrath"
The only main Noldo left in Middle-earth that would have been faintly positive towards him would have been Celebrimbor, except that Celebrimbor had renounced his father and all that went with it:
In that time Celebrimbor the son of Curufin repudiated the deeds of his father, and remained in Nargothrond.
"Of Beren and Lúthien"
Maedhros may also have not been particularly popular after masterminding the Union of Maedhros and the resultant Nirnaeth Arnoediad which pretty much put an end to Elves as a major force in Middle-earth, and also indirectly lead to the end of Gondolin and Nargothrond as well.
Guilt/Hopelessness/Conscience
In addition to, and alongside, the impact of the previous three points:
All of his brothers were dead, save Maglor, and he had no children.
As the eldest son of Fëanor, and temporarily the High King of the Noldor in exile, he felt responsibility for the Oath and the acts/consequences therefrom, and he showed a tendency to act independently and take responsibility not only for his actions but the actions of the sons of Fëanor in general, for instance when he passed the Kingship of the Noldor to Fingolfin after his son, Fingon, rescued Maedhros from his captivity hanging at Thangorodrim:
There Maedhros in time was healed; for the fire of life was hot within him, and his strength was of the ancient world, such as those possessed who were nurtured in Valinor. His body recovered from his torment and became hale, but the shadow of his pain was in his heart; and he lived to wield his sword with left hand more deadly than his right had been. By this deed Fingon won great renown, and all the Noldor praised him; and the hatred between the houses of Fingolfin and Fëanor was assuaged. For Maedhros begged forgiveness for the desertion in Araman; and he waived his claim to kingship over all the Noldor, saying to Fingolfin: 'If there lay no grievance between us, lord, still the kingship would rightly come to you, the eldest here of the house of Finwë, and not the least wise.' But to this his brothers did not all in their hearts agree.
"Of the Return of the Noldor"
He felt guilt for the Sack of Doriath:
Now when first the tidings came to Maedhros that Elwing yet lived, and dwelt in possession of the Silmaril by the mouths of Sirion, he repenting of the deeds in Doriath withheld his hand. But in time the knowledge of their oath unfulfilled returned to torment him and his brothers, and gathering from their wandering hunting-paths they sent messages to the Havens of friendship and yet of stern demand. Then Elwing and the people of Sirion would not yield the jewel which Beren had won and Lúthien had worn, and for which Dior the fair was slain; and least of all while Eärendil their lord was on the sea, for it seemed to them that in the Silmaril lay the healing and the blessing that had come upon their houses and their ships. And so there came to pass the last and cruellest of the slayings of Elf by Elf; and that was the third of the great wrongs achieved by the accursed oath.
"Of the Voyage of Eärendil and the War of Wrath"
He felt guilt for the abandonment of Elured and Elurin:
But Dior returned no answer to the sons of Fëanor; and Celegorm stirred up his brothers to prepare an assault upon Doriath. They came at unawares in the middle of winter, and fought with Dior in the Thousand Caves; and so befell the second slaying of Elf by Elf. There fell Celegorm by Dior's hand, and there fell Curufin, and dark Caranthir; but Dior was slain also, and Nimloth his wife, and the cruel servants of Celegorm seized his young sons and left them to starve in the forest. Of this Maedhros indeed repented, and sought for them long in the woods of Doriath; but his search was unavailing, and of the fate of Eluréd and Elurín no tale tells.
"Of the Ruin of Doriath"
He refused to help burn the ships during the voyage of the Noldor to Middle-earth which stranded Fingolfin and his people at Aman, forcing them to traverse the Helcaraxë where they suffered enormously (Turgon's wife, Elenwë died during the crossing):
But when they were landed, Maedhros the eldest of his sons, and on a time the friend of Fingon ere Morgoth's lies came between, spoke to Fëanor, saying: 'Now what ships and rowers will you spare to return, and whom shall they bear hither first? Fingon the valiant?' Then Fëanor laughed as one fey, and he cried: 'None and none! What I have left behind I count now no loss; needless baggage on the road it has proved. Let those that cursed my name, curse me still, and whine their way back to the cages of the Valar! Let the ships burn!' Then Maedhros alone stood aside, but Fëanor caused fire to be set to the white ships of the Teleri. So in that place which was called Losgar at the outlet of the Firth of Drengist ended the fairest vessels that ever sailed the sea, in a great burning, bright and terrible. And Fingolfin and his people saw the light afar off, red beneath the clouds; and they knew that they were betrayed. This was the firstfruits of the Kinslaying and the Doom of the Noldor.
"Of the Flight of the Noldor"
Conclusion
In conclusion, when taking into account his past history and his personality, as well as some poetic desire on Tolkien's part:
And thus it came to pass that the Silmarils found their long homes: one in the airs of heaven, and one in the fires of the heart of the world, and one in the deep waters.
it is reasonable that Maedhros committed suicide when he realised that he could no longer keep his Oath, that he could not return to Valinor nor find a home in Middle-earth, and could no longer live with his actions that led him to that point, for which he could find no other remedy than ending his own life.
N.B. All quotes from the Silmarillion, all emphasis mine.