Consumables on the Enterprise such as food are recyclable, given enough power. And presumably power is all that's needed for phaser shots. But photon torpedoes are manufactured elsewhere and loaded onto the Enterprise, with only twenty on board. That doesn't seem enough for a prolonged mission, especially given scenes like this where three get fired in quick succession.
So presumably the Enterprise had to re-equip periodically during the five year mission? Did it return from the bits where "no man has gone before" to do this or did a space-oiler intercept it?