During The Great Battle of the Last Alliance, there were an estimated 100,000 elves that fought with the armies of Isildur. This was one of the first scenes in the first LOTR movie. However, in the trilogy, it appears that only a small number of elves show up to Helms Deep and overall left the majority of the fighting to the humans. Why did the elves not participate during the rest of the war?
Well, for one thing, NONE of the elves were at Helm's Deep in the books. Peter Jackson made that one up :)
As for why none fought with Aragorn in the Gondor theater of war, there are 3 reasons:
There weren't all THAT many Elves left in Middle Earth by the time of the War of the Ring - most had already left Middle-Earth to sail into the West. There also weren't all that many Dwarves - a lot of them had been killed in Moria, and Erebor was JUST being repopulated from a complete zero at the time of Smaug and The Hobbit.
They actually DID participate in the war, just not in the Gondor theater.
Dwarves had their own problems at the moment to deal with - those of Erebor / the Lonely Mountain along with the men of Dale were besieged by Easterlings to the north.
This was actually by "design" of Gandalf, with the aim of splitting up Sauron's forces:
So it was that when the War came at last the main assault was turned southwards; yet even so with his far-stretched right hand Sauron might have done great evil in the North, if King Dáin and King Brand had not stood in his path.
... (this all from Appendices in Return of the King):
'I grieved at the fall of Thorin,' said Gandalf; 'and now we hear that Dáin has fallen, fighting in Dale again, even while we fought here. I should call that a heavy loss, if it was not a wonder rather that in his great age he could still wield his axe as mightily as they say that he did, standing over the body of King Brand before the Gate of Erebor until the darkness fell.
'Yet things might have gone far otherwise and far worse. When you think of the great Battle of the Pelennor, do not forget the battles in Dale and the valour of Durin's Folk. Think of what might have been. Dragon-fire and savage swords in Eriador, night in Rivendell. There might be no Queen in Gondor. We might now hope to return from the victory here only to ruin and ash. But that has been averted - because I met Thorin Oakenshield one evening on the edge of spring in Bree. A chance-meeting, as we say in Middle-earth.'
Elves of Mirkwood and Lórien came under attack by forces from Dol Guldur at the same time
Elves and Dwarves lived fairly far from Gondor. IIRC at least 500-600 miles for most part but I'll dig deeper. Even had they been free from fighting AND numerous, they wouldn't have gotten there on time.
It seems unlikely that there even were 100,000 Elves in Middle-Earth by the time of the War of the Ring. There were only three Elven realms left - Northern Mirkwood, Lothlórien and Rivendell - and these were small and sparsely populated: the company was able to walk from the borders of Lórien to the centre in a single day, and there seemed to be only a single large town. I doubt they together had anything near that amount of fighters - plus, of course, they did have their own battles to fight during the War.
Many of the Elves were wiped out at the end of the Second Age in the very battle you refer to, and most of the others have been slowly migrating westwards, out of Middle-Earth and over the Sea to Valinor.