Each time you level up, an unmaxed stat is picked at random for increase. At 4 stars in that stat, the increase is always 5 points (if you have less than 4 stars, I think from memory the increase is 4.6, which is why it only appears to increase 4 points sometimes). This process is repeated a further 4 times, for a total increase of 25 points each level up between your unmaxed stats.

As soon as you max a stat it is no longer eligible to be "picked" in this process, so your allocation will be random among your other stats.