When importing a movie into the compositor there is no way to know how long a movie is (in frames).
Go to a texture panel (theres an easy to access one in world attributes), add the same movie there. In the image Load window click the button “Match Movie Length”. Use the number from there in the compositor node for the movie length in frames.
You could load a bunch of movies into different texture slots in the texture panel and match frame length for each one. Then goto the movie input node, and select the appropriate movie from teh drop down list. Saves you re-loading them again. and they already have the frame lengths determined.