How long the ideal time to do meditation? and how if when we meditate and fall asleep, is that okay or not okay?

Shiney X.
Well, the ideal time to meditated is minimum 5 minutes and maximum 10 or so. But this differs from person to person. Some people can meditate 10 or 20 minutes. However, the recommended time is 10 minutes. Perhaps, you may fall asleep if you're bored or in a tired circumstance meditate for the recommended time or more than 10 minutes.

Murthy N.
Start from five minutes and increase the time . As long as you are able to sit quietly and inteospect initially sit for that time. Later you will be able to keep your thoughts away and can meditate with a clear vison and focus. So here time is not important your quality time spent on meditation is that matters.
Also learn about yoga nidra