Lee uses personification in the quote. Personification is a figure of speech in which inanimate objects, animals, plants, or ideas are given human form or human characteristics. The tinfoil of the gum wrappers reflects the light from the sun. Lee chooses to personify this reflection as winking because it is poetic. Perhaps, this instance of personification is also used to indicate Boo's persona in the gift itself. Since the children do not yet know that Boo is the one who puts things in the knothole, this is a clever use of personification indicating that Boo is privy to a secret that the children are not yet aware of: as if Boo himself is winking. This seems likely because when Mr. Radley puts cement into the hole, it symbolizes the way he's treated Boo and speaks to the reasons Boo has stayed closed in (cemented in) his house all this time.
There's no indication that Jem knows Boo is the one putting things in the tree. But when it is cemented, Jem feels as if a significant connection has been lost:
He stood there until nightfall, and I waited for him. When we went in the house I saw he had been crying; his face was dirty in the right places, but I thought it odd that I had not heard him.