Buttermilk will last up to two weeks due to its high acidity level, although it is best the first week. Once opened, it should be used within a week for drinking purposes, but it will be fine for baking often even a bit longer. Always look for the latest expiration date on the carton, just as you would for any dairy product. Keep it refrigerated, and don't let it sit out on the counter or the kitchen table for any length of time.
Like milk, buttermilk can be frozen up to three months, but it's not recommended because it tends to separate.