Most butter-based cookie doughs are great candidates for freezing. Bakeries will make huge mounds of dough and scoop portioned balls out onto a sheet pan. A few of them might actually get baked fresh, while the majority stay tightly packed on a sheet tray. The whole tray gets shoved in a giant plastic bag and transferred to the freezer. Since cookies can bake in about 15 minutes (even from solid, frozen dough balls), your local bakery can pull as many as they need that day from the freezer and restock within minutes if there’s an unexpected cookie rush.
Not all cookies are butter-based. Some are made with delicate whipped eggs, or have a raw dough that doesn’t take well to freezing, like madeleines or tuiles. Cookies like this also get frozen, but instead of freezing them raw, it’s done post-bake. When they’re needed, they’re removed from the freezer and thaw to their former glory within minutes.
You can freeze butter-based cookie dough at home either pre-portioned or in a slab. Pre-portion your drop cookies (cookies that you scoop and drop, like chocolate chip or oatmeal) so you can bake two or three on a whim. In this case, scoop the cookie dough into individual-sized balls and place them onto a sheet tray. The cookies can sit closely together and touch slightly, so you can likely fit a whole batch onto one tray. Put the whole tray in the freezer for an hour or so, until they’re solid. Dump all of the frozen cookie balls into a plastic zip-top freezer bag and store them in the freezer. For cookies that you’ll make into cut-outs (gingerbread or shaped sugar cookies), divide the dough in half and roll each out into a flat disc about a half inch thick. This will help them thaw quicker when you need them. Double wrap the cookie slabs and store them flat in the freezer. Well-wrapped, deeply frozen cookie dough can keep excellently for eight months to a year.
For leftover, baked cookies that you just can’t seem to get through (or you just like to prepare for inevitable cookie cravings), let them cool completely and transfer the entire sheet tray to the fridge for an hour or so until the cookies are solid. Then dump them into a freezer safe bag for storage. Pull out individual cookies as needed and let them thaw on the counter briefly, or skip that part and deliver them frozen and cold into your mouth.