How do pins on an arduino mega 2560 work?
there should be two pins for every node one acting as the negative terminal and other as the positive terminal. 


No, there is one pin per node, and a common "Ground" pin which is the negative terminal. On your Mega2560 are 5 ground pins (effectively equivalent because they are connected). They are circled on the photo below, and marked GND on the board.





As Majenko says in his answer you must use a resistor in series with any LED you connect, or you will damage both the LED and the processor.

You may find a "breadboard" handy for making connections, most prototyping boards have a long connected strip for sharing the Ground wire between different places, like this:



The continuous blue lines indicate pins which are connected together (for Ground) and the continuous red lines are connected together for +5 V (usually).




  Btw can you tell me why there are two pins on the bottom horizontal row? 


Just for convenience. You often want an extra ground pin, for example if you are trying to connect up two LEDs.


  Secondly, yes each pin can be set as input or output but is there any specific difference in the type of pins?


Some of the pins can optionally be used for extra hardware-supported features.


PWM: Pulse-width-modulated output
COMMUNICATION: Serial input/output (4 serial ports)
ANALOG IN: Analog-to-digital converter (ADC) input
DIGITAL: Digital (not analog) input/output
SDA/SCL: I2C communications
Pins 50-53: SPI communications (not marked on the board)


However all pins, as you noted, can - if you wish - be used for digital input or output.