DPI measures printer output: how many separate dots of ink or toner fit in one inch. A desktop inkjet may print at 1200 or 2400 dpi, a laser printer at 600 or 1200. The higher the number, the smoother the tones and the finer the detail, up to the limit of what paper and eyes can resolve.
In everyday use DPI is also applied to images, where it strictly means PPI, pixels per inch. The practical rule is 300 pixels per inch at the final printed size. An A4 photo at 300 dpi needs 2480 × 3508 pixels; a 4 × 6 in print needs 1200 × 1800. A billboard seen from 20 m looks fine at 30 dpi.
Resolution should match the viewing distance. Business cards and books need the full 300; posters read at arm’s length can drop to 150; anything on a wall across a room can go lower still.
Every paper size at every common resolution is tabulated on paper sizes in pixels.