Tulamide's pretty much nailed it, but even I got confused reading the second last paragraph.
Images are stored with a fixed amount of pixels - eg. 512x512, and that takes up a certain amount of space (format, compression etc).
When it comes to printing, and the dpi/ppi (dots/pixels per inch) is relative to physical size on paper. Monitors are fixed at either 72 or 96 dpi (I'm not certain which). Either way, it doesn't matter on screen because everything is measured in absolute pixels, regardless of resolution or screen size. 512x512 on a 36" monster screen will be physically larger than 512x512 on a cheap 14" LCD.
Paper is a different story, because it doesn't have pixels, rather it has cm/inches. Most printers will do 300dpi at least, but 600 and 1200 dpi aren't uncommon, particularly in laser printers. What happens is your 512x512 image is upsampled to 300/600/1200 dpi by the print driver. Ie. it stretches that 512x512 to 2135x2135 (300 dpi), or 4264x4264 (600dpi).
This is why printing jpgs from the Internet makes them look jaggy and terrible, because they're upscaled so much.