DIM comes from FORTRAN's DIMENSION statement, inherited by BASIC in the 1960s and later reused as a generic abbreviation for "dimension" in data work.
FORTRAN (1957) introduced the DIMENSION statement to declare arrays. BASIC, designed in 1964 at Dartmouth, shortened it to DIM. The keyword survived into Visual Basic, where it declares any variable, not just arrays. From there, "dim" became a generic shorthand in data modeling: a dimension is an axis of a cube, and dim is the label on the axis.
Dim is a shorthand for DIMENSION. That existed in FORTRAN before, so it is likely that it was picked by influence of FORTRAN.
— Stack Overflow answer, 2009