To rename a pet, go into the Pet Journal and right click on the pet. Currently you can rename your pet as many times as you want. The pet's name can include spaces but no special characters.
Side note: There's also an option to "release" the pet you've right clicked on. That option doesn't do anything at the moment, but I'm wondering if it has something to do with trading/selling pets? We'll see.
Once you've renamed your pet, it will automatically change to that name (if you have that pet out). It's a bit buggy, though, because when I unsummoned my pet and then resummoned it, the name reverted back to its original default name. If I unsummon it and then resummon, the new name shows up.
Not sure if this is intended and/or if this will change, but if you rename a pet but summon it using your spellbook companion tab, the new name isn't used. It's default name for the companion is used instead. So far only pets summoned using the Pet Journal use the name you've assigned.
And here is my little Armadillo Pup, renamed to Arnold! Not very original, I know. :P