The current version of the operating software on the iPhone is version 3.13 (7E18). To find out what version you are running go to Settings, General, About.
Scroll down until you see the version number.
Updates to the iPhone Operating System are done through iTunes.
Find out more information on using iTunes to update your iPhone OS