Your level is based on a formula which uses six skills: your three primaries, your two highest majors and your highest minor.
The official formula is: (INT((current total - starting total) + 28)/15) = your level
This means the game adds your current highest skills (primaries + 2 majors + 1 minor) and subtracts your starting highest skills (primaries + 2 majors + 1 minor). It adds 28 to the result and then divides the whole thing by 15, dropping any remainder. The +28 is the reason that most characters will find themselves gaining a level while in Privateer's Hold -- you're only 2 skill increases away from 2nd level..
Let me make it easier: get a total of 15 gains in primaries, majors and/or 1 minor skill and youll gain a level.
OK, youve managed to get 15 gains in your highest skills and youre ready to go up a level. Youll see the increase when you finish resting, provided it has been at least six hours since your last skill increase. This is why its a good idea to save the game before you rest. When you go up a level you get two things: you get an increase in your health points (somewhere between 50% and 100% of whatever you decided on plus any bonus points for high Endurance) and you get 4 to 6 attribute points to distribute. If you saved the game and you get the bare minimum, you can reload, rest again and see if you can get more. If your Endurance is magically enhanced at the time you gain a level, the game will include the bonus for the enhanced END (in case you ever wondered what an item "of Fortitude" was good for).
The health points will be added on automatically, but you can see how many you got by looking at the difference between your current and maximum health on your character sheet. The attribute points will be off to the side of your strength. Just click on the attribute you want to increase and then click on the up arrow to add points. If you change your mind, you can use the down arrow to take them back and put them elsewhere. By reloading and resting you can make sure you get the maximum benefit from each level gain. Youll probably have to reload several times to get it, but thats how you max out each level.
A note on maxing each level gain (and a quick lesson in probability): The more hit points you gave yourself in character creation, the harder it becomes to get the maximum. The hit point gain and attribute bonus are random numbers. For example, if you gave yourself 20 hit points per level, you have a 1 in 11 chance of getting the full 20 points. Remember, you get between 50% and 100% of your hit points with each level, so this means you'll get between 10 and 20 points (inclusive). You automatically have a 1 in 3 chance of getting the maximum attribute bonus. This means that you have a 1 in 33 (11 x 3) chance of hitting the right combination to get the max hit point AND max attribute bonus. Alternatively, if you left your hit points at 8 per level you have a 1 in 4 chance of getting the max which comes to a 1 in 15 (5 x 3) chance of maxing both. The moral of the story? Don't get greedy. The more hit points you give yourself, the more times you'll have to reload in order to hit the maximum gain. So not only does it make developing your skills more difficult, it makes it more of a pain to max out.
The tough point comes at extremely high levels. Your attributes can only go up to 100. When all of your stats are at 100 you cant increase your attributes. A major bug used to freeze the game since you couldnt exit the character sheet with any undistributed points, but it has been patched. In earlier versions of the game you stopped gaining levels once any skill reached 100. This bug has also been fixed.
By normal means it will be impossible to get all of your stats to 100. There are a couple of ways to get close to this, though. One involves the artifact, Oghma Infinium, which gives you 30 points to distribute among your attributes. More about that in the Artifacts section. The other is to contract Vampirism or Lycanthropy. Vampirism adds 20 points to all of your stats (except Intelligence) while Lycanthropy adds 40 points to Strength, Agility, Endurance and Speed. Neither the Artifact nor the diseases will allow you to take any stat over 100.