Use the output size as your target
For a 10 × 8 inch print at 300 PPI, a matching image is 3000 × 2400 pixels. At 240 PPI, the same print needs 2400 × 1920 pixels. Cropping can reduce the pixels available.
PPI is one part of quality
Focus, motion blur, noise, compression, sharpening, paper, printer, and viewing distance all affect the result. A clean lower-PPI image can look better than a damaged file with more pixels.
Calculate print size from actual pixels
Print width in inches = pixel width ÷ target PPI; height uses the same calculation. Multiply inches by 2.54 for centimeters. A 3000 × 2400 pixel file gives 10 × 8 inches at 300 PPI, 12.5 × 10 inches at 240 PPI, or 20 × 16 inches at 150 PPI. Changing only the stored DPI/PPI tag does not add pixels. These sizes assume no cropping or resampling; focus, compression and viewing distance also affect the result.