Nowadays it's generally done when the child is born since you have to provide SSN for every child you claim on your taxes. Back in the day I don't think you needed a SSN until you first got a job.
It was 1986 when SSN's of claimed dependents over 5 years of age to began be required on the 1040. That would have been when my daughters got theirs. The oldest one turned 12 in '86. The youngest turned 6. So they would not have had any jobs yet.
However Obama would likely have worked some in Hawaii, and thus would have needed a SSN, before he went to Occidental. But even then he would have had one issued in California (Some schools used the SSN as student ID number in those days, mine did in '68, and my military ID number is also my SSN, that started in '69, '72 or '74 depending on branch of service. Of course Obama never needed one for that.