Hi Dave,
If your BT Home Hub is quite old (had BT broadband for a long time - received one of the original home hubs), what I would suggest is a firmware update - you'll need to do this via the Home Hub itself and using BT Help.
Your may have the 'BT Broadband Help' application on your PC, which will be able to advise you. If not, find out the model number of your Home Hub, either via the web admin or by looking on the router itself. Have a quick Google or search through BTs knowledge base / help system online and find out if there is a firmware update available.
Alternatively, I have found in the past - that the iPhone is a little fussy over what encryption method is used on the router (WEP, WPA, WPA2 etc), login to the Home Hub and change between the wireless encryption types; please keep in mind, you will need to reconfigure/reconnect your other wireless devices (laptops etc) if you change these settings.
Finally, double check the encryption key/password that you are entering into the iPhone is 100% correct - it could be case sensitive in some cases, so follow the format of the encryption key to the exact letter.
I feel outdated firmware is the most likely cause, from the symptoms you have described - working temporarily and then not at all. I would definitely try and do this first.
If you need any more help, drop me a PM and we'll carry on from there.
All the best,
Ryan