A pump converts rotational force on its shaft into pressurized oil to supply hydraulic components. Example: electric or gas motor turns pump shaft, pump supplies oil to a cylinder. Pumps generally have a large suction port and a smaller pressure port.
A hydraulic motor converts pressurized oil to one of its ports into rotational force on its shaft. Motors generally have equal size ports.
Pumps & motors sometimes look alike. A major difference is the shaft seal. The low pressure suction chamber of a pump provides an ideal place to drain pressure away from the inside of the seal. So most pumps have very low pressure shaft seals. Hydraulic motors usually require higher pressure shaft seals.