Hey,
There is a little bit of misinformation here about mega pixels and print sizes. I'll try to keep this from getting confusing but it can start to be till you get used to how things relate. Just like shutter speeds and f-stops are interrelated, pixels (mega pixels, MPs, is a measurement for the total of them on a sensor) and DPI are interrelated.
MPs (megapixels) absolutely directly relates to larger print sizes given that a particular quality is desired. You take the horizontal pixels on a sensor and the vertical pixels on a sensor and multiply them. That's the MP of the sensor. If it's 900 x 400, well, you don't have many. But if it's a professional DSLR or nice DJI sensor, you may have 5000+ x 4000+ pixels. What people don't understand well is that just increasing the DPI you send to a printer does not necessarily mean you'll get a sharper print. Most consumer level inkjet printers don't show any difference in quality once you exceed 150 DPI or so. Same is true for professional inkjets, it's nearly impossible to see the difference of prints over 200 DPI.
But, that is good news and here's how it relates. Say you have a sensor that is 1000 pixels wide. And imagine you want to print at 100 DPI for a pretty nice inkjet print. You divide 1000 by 100 and you get 10. So at 100 pixels per inch, you'll have a 10" wide print. If you want a print that is 20" wide, you can certainly do it but there will only be 50 pixels making up each inch and it will look fuzzier, take 1000 and divide by 20. So now back to MP and bigger is better. If you have a 5000 pixel wide professional sensor and want to make a print 10" wide, you'd technically have 500 pixels per inch. That's useless because at 200 or over it's just not perceivable. But what this does mean is that now you can do a 100 DPI print, wall mural, trade show backdrop, etc., that is 50" wide at 100 DPI.
What people also don't understand well is that the DPI you use for a print is really dependent on "viewing distance." If you are doing 8x10 prints that you hold and can get close to, then 150DPI is probably the lowest you should go when printing. If on the other hand, it's for a billboard that is 300' from the road, then you can print at 40 or even 20 DPI and it will look great. At 300' you won't see the dots. Going back to our MPs, 5000 pixel wide sensors can deliver a 250" (20.9 feet) wide print at 20 DPI.
Final bit of info. People also think that more MPs means better camera. Not so. My dad just called me and said he bought a 15MP camera and it was going to rival any of my DSLRs. No so. He paid $100 for it and the sensor is half the size of a dime. A 15MP camera sensor that is 1" x .6" will be a much higher quality image for the same MPs because each pixel is bigger and can absorb and process the light falling on it much better. So just because you have a lot of MPs does not necessarily mean you have good image quality. You can have 15MPs on a tiny sensor and have crappy image resolution or have 15MPs on a large sensor and have outstanding image quality. Both are still 15MP. MPs is a measurement, x times y, not a quality indicator. You can have two rows of six eggs for a nice dozen. You can have two rows by 6 of broken eggs and still have 12, but not as nice.
Bottom line, shoot the largest images you can at the lowest ISO/ASA you can and still maintain sharpness and adequate shutter speeds. After that, it's all about deciding how far the viewer will be from the print and adjust your DPI to follow.