Although these two terms are similar, they are not quite the same thing.
Image size refers to the total number of pixels in the image. This is calculated by multiplying the number of pixels in the length to the number of pixels in the breadth of the image, in the same way that one would calculate the area of a rectangular figure.
Resolution refers to the detail or the amount of quality in the image. You cannot know how large an image is if you only know the resolution. This is calculated by measuring the total amount of dots of information in a square inch of the image. Thus, the unit for resolution is dots per inch or DPI.
An interesting fact is that print resolution is far greater than screen resolution. The typical computer has a resolution of 72dpi, and thus all images used on the internet need to have a resolution of 72dpi.
By contrast, print resolution can range from 300 to 1000 dpi.
High resolution images take significantly longer to download, even though they don’t improve the quality of the image! For this reason, large JPG or JPEG files need to be compressed in order to improve online display speed.