Personally I’ve had several different ways to do this over the years. I’ve run games where I just gave players full access to the spells in the PHB, a long time ago when I was younger an silly. It did help us all to learn the spells however, so that was nice. In one campaign I forced players to create their own spells using the PHB power scaling as a guide. I’ve gone through and hand-picked spells a player would receive, occasionally to their dismay. There’s also static charts that say you get X# of spells at level 1, and you’re on your own for the rest. Hell, in playing 3e/pathfinder I’ve been allowed to take spells simply by leveling up.
Currently I’m running a variation based on your intelligence and the random schools of magic your instructor was most comfortable teaching. As I’ve been tweaking the arcane/divine spell listings I’ve become much more fond of the schools and domains as a gating mechanic. It works just as well with your initial spellbook, and makes sense for how I feel students would learn new things. Obviously a powerful wizard would have spells all over the place, but I consider the schools each have their own particular flavor, in which learning more spells from a single school would become easier over time (making a note, turning that into an actual Learn Spell bonus).
Functionally, the higher your INT, the better chance you’ll receive more spells at level 1 to add to your spellbook as learned. Currently players would be able to start, at maximum, with a 22INT, this would give them d8+2 1st, d8+2 2nd, d6+1 3rd, d4+1 4th, 2 5th, and 1 6th level spell. Pretty formidable spellbook!
On the other end of the spectrum with a more modest 16 INT would be d6+1 1st, d4+1 2nd, 2 3rd, 1 4th.
As for learning from an instructor, it sort of touches on how I use Spellcraft in the game. The initial rank in Spellcraft of course is the normal use, knowledge of the arcane, etc. However multiple ranks in Spellcraft are used for teaching others magic. For each rank of Spellcraft (roll a d4) an instructor would be able to teach from an additional school of magic, potentially. Just for randomization what I do is a d4 to check how many schools, then a d8 which correlates to one of the 8 schools of magic. Consecutive rolls of the same number would simply weight the spells in the direction of that particular school.
This also gives players an avenue for teaching others later in their adventuring career by taking multiple slots of Spellcraft as a proficiency and becoming the local instructor of snot-nosed wizardlings. As you might imagine, teaching spells is quite the ludicrous profession, being not only expensive, but drawing the attention of those that might want to catch a wizard sleeping and loot his corpse. As such, an instructor of the arts will likely have somewhere more fortified or remote, say a wizards tower for example, to do their business from.