Both Photoshop Elements 4 and CS2 provide tools to aid the photographer to do this.
If you are using CS2 right click the Eye Dropper tool and additional tools will appear. Select the Measure Tool.
The cursor will change to resemble a ruler. Click on one side of the horizon and draw a straight line to the other side of the horizon and click again to release
From the Image drop down menu at the top of the screen select Rotate Canvas / Arbitrary
A pop up box will appear and Photoshop will have calculated the amount of the angle for the adjustment and whether it is to be Clock Wise or Counter Clock Wise. Click OK
If you wish to check the accuracy of this adjustment, this may be achieved by applying rulers.
From the View drop down menu at the top of the screen select Rulers or use the keyboard shortcut Ctrl +R
Click and drag the ruler to the horizon, this should now be level. To remove this guide from the View drop down menu at the top of the screen select Show / Guides and click to untick this option.
The image that has been rotated no longer fits the canvas and will have some black edges around the border. It will now be necessary to crop the image to remove these from the final picture. To do this select the Crop tool.
Click and draw a selection within the image to select the area to be retained. Use the ‘grab handles’ at each corner and mid centre to move or extend the selected area.
When you are happy with the selection either hit Enter or click on the Tick at the top of the screen, or click on the Circle to deselect and start again.
If you are using elements the whole process is automated, but you may have to check that final results are as you require them. The program makes an assessment using of what is required but may be fooled when there are strong shadow areas around the horizon.
From the Image drop down menu at the top of the screen select Rotate / Straighten Image
Elements will now do the entire process for you, and if you want it will even crop the image if you select Straighten & Crop Image at the final stage. Again you may wish to check that this is how you want it to be before saving any changes.