Why led be is dimmer in pin 2 than in pin 13 ?

Are you using a resistor? It might have too much current going through it, making it dimmer(I'm not sure if that's possible, but maybe?).