The terms don't necessarily have universal definitions and are often used in different ways.
Resolution originates from a definition of how closely two lines or elements of an image can be and still be resolved visually (good explanation here). It is usually used in the context of density--pixels or dots per unit. So Resolution Unit is the unit of measure (e.g., inch), that the resolution is being expressed in.
Resolution is more generally used in the density sense to define how to relate the pixels or dots to physical size. On a typical display, with a resolution of around 96 pixels per inch, an image resolution of 96 ppi would display "full size" (100% zoom), where each image pixel is displayed with one screen pixel. So a 400x600 pixel image would occupy roughly 4"x6" on the screen. Zooming on the screen is accomplished by using a different resolution and then averaging or interpolating image pixels to determine what gets displayed by each screen pixel. You typically adjust print size through the resolution setting. If you print that same image at 200 dpi, the output will occupy 2"x3".
Image width and height are the number of pixels in each direction.
Pixels per unit is how resolution is expressed, but it is also used in an absolute sense (divorced from any notion of visual acuity). It is used as a physical measurement when applied to a device rather than a resolution setting for an image. The computer screen is manufactured with pixels in a pattern at a certain density. The image sensor in a camera packs a certain number of pixels into a certain sensor size. The pixel units would be the unit of measure for the device (e.g., mm for a camera sensor or inches for a screen), so pixels per mm on a camera sensor would be the number of pixels in one mm along one dimension of the sensor. (Technically, "pixel" refers to the smallest element in an image so sensor elements aren't pixels but produce pixels.) The usage in your example is really resolution and reflects a math exercise. If you were to use meters as a unit of measure, that's what the resolution would calculate to be.
Resolution actually refers to one direction. It is often expressed as two resolutions in one to reflect both directions. Density normally reflects resolution (or pixels per unit) in both dimensions.
In scanning, the sensor has optical characteristics that allow it to capture pixels at some mechanically-defined density. That is often different from what you need for a particular use. The scanner software allows you to select a different output resolution, which is accomplished by averaging or interpolating the results from adjacent sensor pixels. The DPI setting defines the image resolution you want the scanner software to output after processing the raw scan.