There is a good understanding of DPI among hardware geeks (they may boast about how superior is tablet X due to a higher DPI display), still I am surprised to see how many people from the photography world do not understand this (sometime don't want to learn, on the "is technical stuff, I am an artist and not care about technical details") to the point it becomes ridiculous, so I will try to explain it with simple words, in case someone will pay attention.
DPI stands for "Dots Per Inch" and is a characteristic of a hardware device (for example a computer/tablet/phone display). It says how many pixels are in one inch (1 inch = 2.54 cm). Example: the computer I use to write this piece has a 38 cm wide display, which is 38 cm / 2.54 ~= 15 inches. Considering the horizontal resolution is 1600 pixels, then it has a resolution of 1600 pixels / 15 = 106.67 DPI. Of course, the higher the DPI value, the better looking the image will be on your display, as it will enable to to see finer details.
In digital photography the situation is different: your photo is a file and it can be put on a wide range of displays. The DPI value is not as important as the actual image resolution in pixels, it is actually
metadata. Actually the correct term when talking about photos is PPI, standing for "Points Per Inch", but PPI and DPI are close enough, is not a huge problem if you interchange them. PPI is relevant when you
print the image, is the density of color points to be printed by a inch. The math is similar and having a target print size and print image quality (PPI), it will help determine the needed pixel resolution. Example: you want to print a 15 x 10 cm image at good quality (300 PPI). On the horizontal 15 cm / 2.54 = 5.9 inch, then 5.9 inch * 300 PPI = 1770 pixels. On the vertical, 10 cm / 2.54 = 3.96 inch, then 3.95 inch * 300 PPI = 1182 pixels. In conclusion, you will need a 1770 x 1182 pixels image. 1800 x 1200 is close enough and easy to remember, so a 1800 x 1200 image will print at good quality at 15 x 10 cm.
JPEG is the file format we use day to day to exchange photos and it has the ability to store a DPI value somewhere inside its metadata, but is only metadata: an indication at which size (in cm or inches) to print the file. But you can print the same file at any dimension or any DPI/PPI value (of course, with the respective image quality consequence). Changing this value won't modify in any way the look and work of your digital file.
Now, what is a good DPI value for your print? This depends on its intended use, of course :) A 300 DPI is considered good enough for a quality print, like those in the glossy magazines, where you look closely and expect to see fine details. When printing a poster which will be seen from a couple of meters, you can lower the DPI value at 100 and for a billboard to be seen from tens of meters, you can go way lower: it does not mater the printed points are huge when looking closely, nobody will do that.
Now another practical example to illustrate the ridiculous part and how to deal with it. For a recent
photo exhibition (it is still on display), the requirements were "100x66 cm at 240 DPI". This is ridiculous: 100 cm / 2.54 = 39.4 inch, 39.4 inch * 240 DPI = 9456 pixels and 66 cm / 2.54 = 26 inch, 26 inch * 240 DPI = 6240 pixels, so to satisfy it you need a 9456 x 6240 photo, which means 9456 * 6240 = 59005440 - you need a 60 Megapixel camera to produce it. Nobody in the target group for that expo has access to such a camera. What to do?
Knowing the people, I can safely say most of them just ignored a requirement they don't understand, and even if they understand can't follow. Still, some tried their best and this is the right thing to do, consider other exhibitions have sane requirements you can, and then should, follow, like the one asking for 1400 x 933 at 96 DPI.
The most obvious thing to do is to resize your image to achieve the needed resolution in both pixels and DPI (GIMP example below). This is sensible thing to do when you scale down the image, as in the 15 x 10 cm case, (reduce the pixel resolution count) and you can optimize interpolation method and post process your image. However, when it would need to scale up, as in the 100 x 66 cm case, is not only a waste of resources and time, extrapolation will lower the image quality so the result will be worse than printed at a low DPI value.
What I do in such cases (and I got my images accepted in quite a few exhibitions) is to give the image at the largest pixel resolution I have available and then set the metadata DPI value for the desired target in centimeters, even if lower than the requirement. Is going to be the best print I can anyway.
Most of the photos you will encounter have a value of 72 DPI, this is because that is the value assigned by default by the camera for historical reasons: it was the common resolution for computer displays when digital cameras were introduced to the market, at the time we used 14"-15" CRT monitors. I am not sure I can change it inside my Canon, but it does not matter: most of my photos are to be shown on a computer display and I can change the value (as shown above) when editing for a special print.
Of course, as I told above is specific to photography. For illustration/vector graphics is a different matter, we may talk about at another time if there will be enough interest.