Jesse bought a $340$ -gram bag of ground coffee. He uses $18.75$ grams of ground coffee each day. When there are $40$ grams of ground coffee remaining in the bag, Jesse will buy another bag to make sure he doesn't run out of coffee.

To find out how many days the bag of coffee will last, we first need to determine how many grams of coffee Jesse will use before he buys a new bag.

Let $x$ be the number of days the bag will last.

Since Jesse uses $18.75$ grams of coffee each day, the total amount of coffee used after $x$ days is $18.75x$ grams.

The total amount of coffee in the bag is $340$ grams, and there are $40$ grams remaining before Jesse buys a new bag. So, the total amount of coffee used is $340 - 40 = 300$ grams.

Setting up an equation to solve for $x$:

$$18.75x = 300$$
$$x = \frac{300}{18.75} = 16$$

Therefore, the bag of ground coffee will last Jesse $16$ days before he buys a new bag.