So, for each skill, d% is rolled. If the result succeeds, the unit will gain 1 point to the stat. If it fails, no improvement is made on this level.
For HP, as 86 overpasses the 20% chance, HP does not go up. However, for STR, 24 is under the 40% for C, so the unit gains 1 STR. The same applies to DEF, with 01 being under 80%. However, RES and SKL do not go up as 52 goes over 20%, and 59 and 77 both go over 40%. SPD and LUK both go up 1 point as 49 and 10 are both under 60%.
When an unpromoted unit gets a class promotion, from either an upgrade item or reaching lv 21, the unit gains specific stat upgrades, and does not roll for improvements at this level. However, starting from lvl 1 of the promoted unit, the unit will roll for stat improvements again at future levels.