It is never explicitly mentioned whether Snape knew who exactly stole from his private stores during the second book, and in fact, blaming anybody for the loss of ingredients in his second book does not even come up until the particular quote in the question from the fourth book.
This is from the second book (Chamber of Secrets):
"If I ever find out who threw this," Snape whispered, "I shall make sure that person is expelled." Harry arranged his face into what he hoped was a puzzled expression. Snape was looking right at him, and the bell that rang ten minutes later could not have been more welcome. "He knew it was me," Harry told Ron and Hermione as they hurried back to Moaning Myrtle's bathroom. "I could tell." Hermione threw the new ingredients into the cauldron and began to stir feverishly.
This particular passage implies Snape was blaming Harry for the explosion in his class (upto this point it is not about potion ingredients), but then again, Snape would probably blame Harry for everything anyway.
The potions ingredients mentioned in your quote in particular refers to the theft occuring during Goblet of Fire, when Barty Crouch Jr. would have needed significant amounts of the ingredients to make polyjuice potion throughout the year.
Also, ingredients seem to be prone to theft from Snape's private stores on multiple occasions, as shown by this quote from Goblet of Fire:
"On the contrary," growled Moody, "it is very important. Who'd want to break into your office?" "A student, I daresay," said Snape. Harry could see a vein flickering horribly on Snape's greasy temple. "It has happened before. Potion ingredients have gone missing from my private store cupboard ...students attempting illicit mixtures, no doubt..." "Reckon they were after potion ingredients, eh?" said Moody. "Not hiding anything else in your office, are you?"
So the fact that Harry thought Snape knew he was behind the theft of the ingredients during the second year is probably due to his own guilty conscience, further fueled by Snape's prejudice against him.