They both are. In a series circuit such as that, it does not matter the order of how the led and resistor are wired. What is important is that the diode direction is wired correctly as it will not function if wired backwards, and that the resistor have the proper ohm and wattage values for the circuit it's being used in.
Electrically, they are both correct. However, I would consider it good practice to install the resistor to the output pin and the LED to the ground pin. The reason being that, if you screw up part of your hook-up there is a good chance the resistor will still , provide current limitation protection to your arduino.