Its based on what skills you raised between the two levels. Each skill is goverened by one of the attributes. Blade is strenght, Conjuration is intelligence, sneak is agility, etc. Each time you raise a skill it increases the ammount that the governing attribute will be raised should you select it at level up. So if you want to get your intelligence higher in the next level up, raise the skills goverened by it mulitple times. I'm not sure how many it takes, but I think its +2 for the first and second skill for an attribute. Each skill raised for the attribute then adds an additional +1 up to +5. And non major skills are factored as well, so its not just the major skills that are monitored for skill raises. And if you don't level up right away, it continutes to monitor what skills are being used during the next 10 major skill increases. So if you raise your major skills 20 times between sleeping you would then raise 2 levels and the game would have kept track what skills you used during the 11-20 skills.