That depends. If you accidentally downloaded the Creative Cloud desktop app and installed Lightroom from that as a trial you can't enter a retail, stand alone, license serial number into that version. You must first uninstall that version and install the Stand Alone version from this link.
And specifically from this link.
Then when you first start Lightroom you will get a screen that asks you to Buy, Try/Trial or Enter a serial number. Since you already have a serial number you would select Enter a Serial Number.
If you did download and install the stand alone version then that Trial/Try, Buy screen should come up every time you start LR. If not then go to the Help or Lightroom menu item and select Lightroom Registration. Click the Next button and a screen will come up where you can enter the serial number. But if you don't get the Trial startup screen and the screen where you enter a serial number is already filled in then you have the Creative Cloud version and ypou must do as I say above.
Thank you. This worked perfectly! It's a pity Adobe doesn't make it clear that there are CC and non-CC versions of its products. When I Googled "Adobe Lightroom 5 download" the only links I could find were to the CC product.
I also spoke to Adobe support, who were great, and who told me the same solution as you offered.
Plus 1 for the idea of Adobe putting a notice beside the Cloud version of Lr to warn downloaders that they should be careful to get the right one - but they're never going to do that, as it would advertise the existence of the perpetual version.