Q:

Why does the director's name always show up in the end of the credits?

I have noticed that during the opening credits of a movie/TV show, the name of the director(s) always shows up last, at the end of the credits. I'm not really sure if that happens in the ending credits as well.
Is there any reason as to why to do that?

A:

In the USA, this is governed by the agreements of the Director's Guild of America.  
Their basic agreement states in section 8-201 that:

No other credit shall appear on the card which accords credit to the Director of the film. Such credit shall be on the last title card appearing prior to principal photography.

This convention even appears to cover movies that are made outside the US.  I'm not sure whether that is because of legal agreements or just because the US movie industry is the model for many around the world.
Wikipedia and IMDB states that George Lucas was fined $250,000 by the DGA for breaking the terms of the agreement by just having the title of Star Wars and The Empire Strikes Back in the opening credit, and not mentioning the director.

