Web cookies (also called HTTP cookies, Internet cookies, browser cookies, or just… cookies) are small blocks of data that get stored on your web browser when you're browsing a website.
More specific to affiliate programs, third-party tracking cookies are the foundation for how your affiliate referrals are tracked and attributed, as tracking cookies are the most common way to compile records of browsing history. When someone clicks on your (coded) affiliate link and heads to a partner's website, that special link will apply a tracking cookie to the person's web browser—and log them as a referral from you.
Cookie duration refers to how long into the future you'll receive credit for a referral when someone clicks on an affiliate link of yours. For example, if someone who clicks on your affiliate link doesn't make a purchase right away, the company's website has already applied a cookie to their browser (that packet of stored tracking information), so that they'll recognize the person whenever they come back to their website. And if their affiliate program specifies a 30-day cookie window (most common), then you'll still receive credit for the referral if they return and make a purchase within 30 days of initially clicking on your affiliate tracking link.