Megapixels refers to the total number of pixels that your camera's sensor captures when taking a picture. A typical 6 megapixel camera captures an image that is about 2000 pixels tall by 3000 pixels wide. 2000px X 3000px = 6 million pixels total.
Megabytes (MB) refers to how much storage space a file occupies on disk. The 6 megapixel camera file described above would require about 17 MB if it was save in an uncompressed format such as a TIFF file. When stored as a compressed file, such as a JPEG, that same 6 megapixel images might only require anywhere from 1 MB to 5 MB.
Dots per inch(DPI) is a way to describe the resolution of the image at a given print size. DPI is a measurement of how many pixels are in 1 inch of of the image. For example that same 6 megapixel camera file is 250 dpi at 8"x12", but it could also be described as 500 dpi at 4"x6" or 200dpi at 10"x15". As the size of the image changes, the number of pixels that make the image up remains constant, so that at smaller sizes there are more pixels per inch and at larger sizes there are fewer pixels per inch.