First, For() is a function, not a message for a data table, that does not return a reference to a new data table. Second, why start the loop index at 25? Third, why concatenate a prefix after the name? That result is a suffix.
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
prefix = dt:sex[1];
For( i = 1, i <= N Cols( dt ), i++,
cName = Column( dt, i ) << Get Name;
newname = prefix || cName;
Column( dt, i ) << Set Name( newname );
);