The number should usually be a close to the conversation. If you've got better game than that, there should be a kiss close. If you've got amazing game, insta-date. Or lay. Whichever. But, still - the number has to come first before those, and that's usually the closer. After you "tell" her you guys are getting together, and then you "tell" her to give you her number. Don't ask - if you don't ask, there's less chance they'll say no.
NOW. In times where you don't have a lot of room to talk, passing notes works wonders. Funny sketches, games (tic-tac-toe), just quick little notes back and forth - lots of C+F, sarcasm. Get her to laugh and you've got her.
The best way I've found to do it is to play hangman - use a couple of simple words, then make it a little harder, and then ... draw the gallows, and put this
(_ _ _) _ _ _ - _ _ _ _
she'll either get it, and give it to you, or she'll be like "the hell is this?" and you'll say "you don't know you're own phone number?" and she'll give it to you.
I've done it ten times, worked every time.