This is a difficult question because it depends on how well you know the person you like. While there is no hard and fast rule here, the goal is to get to know her well before asking her to be your girlfriend. It all depends on how your interactions with her and your relationship have gone thus far. The longer you have known her, the sooner you can ask her out.