This might be true in the movie, but certainly not in the books. Twice - in the very battle you mention at the end of Fellowship, and again in the battle of Helm's Deep - he is explicitly described as running out of arrows and having to hunt around for more:
'And I,' said Legolas, 'will take all the arrows that I can find, for my quiver is empty.' He searched in the pile on the ground about and found not a few that were undamaged and longer in the shaft than such arrows as the Orcs were accustomed to use.
...
'Two!' said Gimli, patting his axe. He had returned to his place on the wall.
'Two?' said Legolas. 'I have done better, though now I must grope for spent arrows; all mine are gone. Yet I make my tale twenty at the least. But that is only a few leaves in a forest.'
(And yes, he does later go on to use a knife, saying to Gimli: "It has been knife-work up here.")
On a side note, I've always found this set of exchanges between Legolas and Gimli to be faintly disturbing. Although Orcs are "evil", and their enemies in this battle and the wider war, they are still sentient creatures and I would have thought Legolas - as a "good" Elf - would at least show some form of regret at the necessity to slaughter them. But instead, he revels in it and turns it into a competition with his friend. As I say, disturbing.