The only thing in the world that dictates how many pixels are you getting while taking a picture with a digital camera is... The camera.
1) First of all: read the specifications on your camera. If it is a simple camera, or a photo taken with a smart phone, the measure is for example 5 Megapixels, 10 Megapixels or something like that.
I'm going to use a round number: 6 Megapixels.
This is a round number because normally the photos have a ratio 3:2, in short, if you have 3,000 pixels on one side you have 2,000 on the other side. 3,000 x 2,000 = 6,000,000. 6 Mega Pixels.
2) How many pixels do i need for a print 17x24?
It depends. It depends on the quality you need.
A good portrait that you are hanging on the wall, about a family member, you can use 200 ppi.
200 of this 3,000 pixels on each inch your print has, so 3,000 / 200 = 15 inches... Ouch It is smaller than expected.
But in a general use, for a poster promoting an event, printed on a plotter you can use just 100ppi so you can print that same file to 30 inches.
In this example you can print 24 inches tall with a 6 Mpx photo with medium results.
For great results you need a 16 Mpx camera for a print that size with the 200ppi I mentioned earlier.
3) If it is the only photo you have... a unique moment in the history of mankind... it doesn't matter. It is the photo you have, and the size you want, and there is no other photo on the planet. So there is nothing you can do, but to enjoy your print.
4) I posted an explanation of the relationship between image size and print size here
5) If you have multiple options on your camera, regarding different file sizes on your photos, just use the higher ones.