First things first - 256 what? Max's default is Inches - did you really intend a pipe nigh on 21 feet across?
Next up - 45 or 90 degrees. To have the ends "line up", be parallel, you'll need 180 degrees.
Snaps won't be of much help - you are parametrically altering the underlying mesh so there's nothing to snap to.
I suspect that you didn't increase the number of Height Segments. Bend works by calculating the required positions of the existing vertices - if there aren't enough the the bend won't be smooth at all and the ends won't end up where you expect them to.
Finally, if you bend it 180 degrees you'll form a semi-circle (viewed from the side). Imagine the centre line of the tube starting at the origin. Circumference of a circle is 2 * PI * Radius. You have half a circle, so half of that, or PI * R. You know half the circumference, it's the height of your tube, 512. Radius will therefore be 512 / PI which is (roughly) 162.954 so there's no way the centre line will end up on the grid. You'd have to work the maths backwards, starting from the required Radius to calculate the initial height of your tube.
Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).