I have been inactive for a while and came back to some of my pet names being taken. I have the event notifications with the following text:
Your pet name Strangers was taken due to inactivity, you have been given a free name change here for this pet only!
When I try to click on the link it points to "www.pets.php" and when I go to the actual pets page I don't see any options to change my pets' names. So how do I use the free name change?
Welcome back! You've missed quite a bit.
At the end of July, non-unique names were implemented, meaning that now more than one pet can have the same name. All pets that were created before the change also have "legacy names", showing that they were the ones to have that name when the non-unique name change happened.
Legacy names cannot be changed; they can only be removed permanently via the bathhouse, or hidden with CSS.
Actual names can be changed, though! Normally, actual names can be changed only once a month (for gold accounts) or once a week (for regular accounts). But since you had your name change, changing the names of these pets right now will not count against you for your weekly/monthly name changes. If it does for some reason - for example, since you're currently a regular account you'd only be able to change one pet's name this week - I'd recommend filing a ticket.
You can read more about the non-unique name change here: FAQ about Legacy Names/Non-Unique Pet Names
And now that all that is out of the way, to your actual question:
When you go to the pets page, there is a tiny arrow in the upper righthand of each pet's section. If you click on it, you should see an option to change the pet's name. It looks like this:

If you have any other questions, I'm happy to help. ^_^
You have to click the dropdown arrow next to the pet whose name you want to change and click Change Name from there :)
Note that unique pet names no longer exist (so you can change your pets' names right back to what they were if you want). GA users can change every pet's name once per month and non-GA users can change one pet name total per week. If you have free name change notifications from before that change happened, changing those pets' names shouldn't eat up your free weekly change, but you may need to file a ticket if it does for some reason. Full news post about the update here [edit] Whoops, ninja'd :P