Optimal YouTube video length is around 8 - 10 minutes. But this depends on your content. Some videos have only a few minutes, but there also videos longer than hour.
If your video has 8 minutes or more, you can place extra mid-role ads into it. According to some people, if the video is too long, there is a higher probability of losing viewers.