Producing more breast milk than your baby needs is a great problem to have. In my experience as a physician, most breastfeeding moms worry about producing too little milk, especially when they start pumping in addition to nursing, so that's why you've more than likely received the advice to never throw out your breast milk, but freeze it instead.
According to the Centers for Disease Control and Prevention (CDC), freshly expressed breast milk can be only safely stored in the refrigerator at 40 degrees F (4 degrees C) for 4 days. However, fresh breast milk can be stored in the freezer at 0 degrees F (-18 degrees C) or colder safely for 6 to 12 months.
Here's how to freeze and unfreeze breast milk safely: