Both sentences are correct.
If you use pour then “pour acheter les nouveaux livres” is a complement which gives a reason. The verb “aller” is then understood as “to go”.
If you don’t, “acheter les nouveaux livres” is then the direct object of “irai”. It’s separated from the verb by 3 other complements: one gives the place, a second one gives time and a third one says how. But you can remove all three to understand the sentence: “J’irai acheter les nouveaux livres”. Here, the expression “aller faire quelque chose“ is used in the future tense.