The pixels (image resolution) and the pixels per inch (document/print resolution) determine how big a print will be.
pixels / ppi = inches
pixels / inches = ppi
inches x ppi = pixels
Today, with DSLR camera's MP generally having 10+ MP, the oft quoted 300 ppi is more a rote figure than what is actually needed.
As print size increase, so does the viewing distance.
As viewing distance increases, the need for print resolution diminishes.
That's why they can print images on billboards at 10 ppi.
Most online print labs stake their print quality reputation by having a minimum print resolution requirement of about 100 ppi.
The media the print will be made on, the type of print device used to make the print, and the image content have a bearing on what value of ppi will be acceptable.
You don't need as much print resolution to print on canvas as you do to print on a matte finish chromogenic paper.
No doubt the more ppi the better, but as ppi goes up - print size goes down.
A 5000 x 3000 pixel digital photo can be printed many different sizes by changing the ppi.
Considering a 5000 px x 3000 px digital photo:
5000 px / 100 ppi = 50 inches ..... 3000 px / 100 ppi = 30 inches
5000 px / 200 ppi = 25 inches ..... 3000 px / 200 ppi = 15 inches
5000 px/ 300 ppi = 16.6 inches ..... 3000 / 300 ppi = 10 inches
5000 px / 400 = 12.5 inches ..... 3000 / 400 ppi = 7.5 inches.
Another consideration is the aspect ratio of the print size you want.
Most DSLR's make photos that have a 3:2 aspect ratio - 4x6, 6x9, 8x12, 10x15, 16x24, 20x30.
If you want an 8x10, a 3:2 aspect ratio photo has to be cropped to the 4:5 aspect ratio to be printed as a 4x5, 8x10, 12x15, 16x20, 20x25, 24x30.
Another popular aspect ratio that requires cropping a 3:2 photo is the 5:7 - wallets, 5x7, 10x14, etc.....
A square print has an aspect ratio of 1:1.
Cropping reduces the image resolution by discarding pixels.
There are many other considerations, like color space, files type, and color management.
Tutorials on Color Management & Printing