When you gain a level, your skill points are spent based on the class skills of the class you gained a level in. But your max ranks in your skills are based on your total character level, and a skill counts as a class skill for this purpose if it is a class skill for any of your classes. (If it is an exclusive skill, only add the levels of classes that have access to it for purposes of maximum levels.)
Take, for example (using real D&D instead of your simplified version-it's not that complicated, really), a 3rd level Wizard who adds a level of Rogue. He gets 11 skill points (8 for being a Rogue, +2 for his 15 Int, and +1 for being human) to spend. The skills he's interested in bumping are Spellcraft, Tumble, and Use Magic Device. Currently, he has 6 ranks in Spellcraft (his max, level + 3), 3 in Tumble (max for a 3rd level wizard is [3+4]/2 = 3), and 0 in Use Magic Device (this is an exclusive skill for rogues & bards, so he couldn't previously put points into it). He spends two points to get a rank of Spellcraft (one rank costs two skill points because Spellcraft isn't a class skill for rogues) for a total of seven ranks (he's a fourth-level character, and since Spellcraft isn't an exclusive skill, his maximum is 4+3=7 ranks). He spends 4 points for 4 ranks of Tumble (this is a class skill for rogues) for a total of seven ranks (again, Tumble isn't exclusive, so his max is 7 ranks). And he spends 4 points on Use Magic Device, gaining four ranks (UMD is a class skill for Rogues) and maxing out the skill (it's an exclusive skill, so only his one Rogue level counts for determining the maximum ranks). He'd love to spend that last skill point here, but these skills are all maxed out. So he spends his last point on Craft (basket-weaving).
Next level, he goes back to Wizard, gaining 5 skill points. He spends one on Spellcraft (maxing it out at 8 ranks) and 2 on Tumble (getting him one rank, as Tumble isn't a Wizard class skill, and maxing the skill out at 8 ranks for his fifth-level character). He can't spend any points on UMD, as it's an exclusive skill that Wizard don't have access to; this is just as well, as his max ranks don't go up for the same reason-that remains at 4, based on his one Rogue level. Looks like those last two points go to Craft (basket-weaving). At least he'll have a career to fall back on when he retires from adventuring ...