To define what a megapixel is, you first need to understand what a pixel is.
The word 'pixel' is short for 'picture element'. A digital camera's imaging sensor is divided up into millions of tiny light-collecting sensors. The camera uses each of these sensors to assemble an image made up of millions of coloured dots. Each individual dot that makes up a photo is known as a pixel.
The term Megapixel refers to how many of these dots make up a photo. One Megapixel is one million pixels. So a 24 Megapixel camera is one that produces images that are made up of 24 million individual dots.