This depends on the structure of your plan and whether there is a discount and a lookback feature for the purchase price. For example, in a common arrangement for plans that are tax-favored under Section 423 of the tax code, at the end of each offering (or purchase) period, i.e. on the exercise/purchase date, the fair market value of your company's common stock is compared with the fair market value of the stock on the grant (or enrollment) date. The price you pay for the stock (the "purchase price") can be up to 15% less than the lower of these two prices. Your company will specify the discount that applies before the offering begins.

Example: When the share price goes up
Price on first Wednesday of January (grant date): $25
Price on first Wednesday of July (purchase date): $30
What you pay: $25 minus 15% (or $3.75 discount) = $21.25

Example: When the share price goes down
Price on first Wednesday of January (grant date): $25
Price on first Wednesday of April (purchase date): $20
What you pay: $20 minus 15% (or $3 discount) = $17

See the FAQ on ESPPs that are not tax-qualified under Section 423. Their structure can vary and may not include a purchase discount beyond waiving the commission.