I like to keep the boxes for the duration of the store return period at a minimum, and for the entire warranty period at a maximum. This is for all products, not just Apple.
Smaller boxes like iPhone, Apple TV, and HomePod mini are easily tossed in a closet and forgotten about, so I still have plenty of those hanging around. Bigger boxes like iPad, MacBook, and iMac eventually get in the way and I throw them out.
None of them have any value to me.