You need to follow the below steps and you will be able to do it easily:
Go to the website windows.php.net/download/ and download the zip package which is required for you .
Suppose you want to upgrade from php5.1 to php 5.3.2 then do the following:
Extract the contents of the zip(which you have downloaded) to C:/wamp/bin/php/php5.3.2 (or the directory where you have installed wamp)
Copy php.ini, phpForApache.ini and wamserver.conf from the php5.1 folder to the php5.3.2 folder. Update the PHP version in php.ini and phpForApache.ini .
Now left click the wamp tray icon and choose PHP > Version > 5.3.2. If you do not see 5.3.2 listed right click the wamp tray icon and choose Refresh. Now try changing PHP version as mentioned.