6V is too low to be applied on the Vin pin (need at least 7V for a reliable operation) and is too high to be applied on the 5V pin (it's too close to the safe limit and you might destroy the MCU).
There are regulators that can give you 5V from a 6V supply, check it out
You may not use the 6V on the usb bus. It will damage the ATmega2560 chip, and maybe more.
You could try 6V to the VIN pin, but there might be current flowing into the computer. The USB power is turned off when VIN is 6.6V or above. When the USB power is not turned of, the 5V is connected via a mosfet to the USB power.
The NCP1117 has a voltage drop of about 1V. So it will work.
That 6V is not from four AA batteries I hope ? The Arduino Mega 2560 board is not the best board for battery power.
Where does that 6V come from? I can hardly believe that it is 6.00V.
If you have a wall wart that has a label 6V, it might be 9V, or more.
i have a short question. My problem is that i have only 6V for the supply voltage. And also i need the analog output 5V.
Does anybody know if the Arduino 2560 works with 6V and where i shoud connect the 6V?
A low-drop out 5V regulator will do the job, find one with a really low drop out (say < 0.5V)
ideally. 6V into the regulator, then you have stable 5V out to the +5V pin, consult datasheet for the necessary decoupling capacitors. (LDO's are fussy)
Is it possible to operate the Arduino over the USB Port but with the 6V?
USB voltage should be between 4.75 and 5.25V, so no.