YouTube videos have views. How long do I have to watch a video for it to count as a view?
Till the end. I don't remember the source, but I read it somewhere in YouTube itself.
Update: According to this page in YouTube support, it's not that simple.
Prior to 200-300 views, view count on the watch page acts as a real time hit counter. Each visit to that page, regardless of who is visiting (even the video owner) increases the view count by 1 (but see the secondary system below).
After 300 views, the whole system changes; the secondary view counters kick in. YouTube has never said exactly what they're counting (or not) but it's known that they throw out the original hit counter and re-evaluate all the page views and only allows hits which YouTube calls a "view".
According to YouTube's FAQ on May 23, 2012:
A view is counted whenever someone watches a video on YouTube. We do not get more specific than this to avoid attempts at artificially inflating view counts.
I would assume they don't count views as soon as you load the video, since that would make it too easy to artificially inflate view counts. Further than that, it's difficult to say.