You should usually know the version of Ubuntu you are running, but in case you can not determine the version you are running, just run this command.
cat /etc/issue
That command will tell you the version of Ubuntu you are using.
[Update]
Somebody sent me an email telling me that this commands are a lot better.
lsb_release -a
or
lsb_release -rcs