Shelf life is determined through stability testing, which involves storing the product under various conditions and testing its potency, safety, and integrity over time. Factors such as temperature, humidity, and light exposure are controlled to understand their effects. The results help to establish the expiration date, which is then used to guide storage and usage practices.