I am not sure about non-jailbroken iphones nor if the earlier version of the iphone has it or not but for jailbroken iphones (3G and 3GS) go to settings,
then select General, select Usage. At the top you should see Battery Percentage switch. Turn it on and you should immediately see your battery life in % as well as the battery level icon. I have the 3GS and did this on my 3G as well. This is the only way I know of to do this without installing an app.
As someone said, it's in the settings on the 3GS. For other iPhones you'll need an app.
I use the 'iStat' application. There are also a ton of battery apps that only show the battery without all that other info. Just search the store for 'battery' and I'm sure you'll find them.