I'm visiting the US for 2 weeks, for example 10th of May until the 24th of May, when the officer asks how long are you staying in the US do I say 2 weeks or 15 days?
It doesn't matter. Both honestly describe your plan. The same goes for saying one week when planning staying for 8 days or one month when planning to stay for 25 days.
If you are still anxious about it, just say "I'm leaving on the 24th" or "my return ticket is on 24th" (if you do have a return ticket).
Unlike some countries or what you might have thought, U.S. generally allows you to stay for six months (if you are Canadian or Bermudian, or have a B1/B2 visa) or 90 days (if you have an ESTA) regardless of your stated plan, though you should always honestly declare your travel plans. In the rare case where they limit the period of your stay, you will know that and more inquiries on your return date are likely to follow.