To cage or release pets, open your Collections (Shift-P) and click on the Pet Journal tab at the bottom. Pets captured in the wild can only be released. Locate the pet in the left pane, right-click, and select Release. Most other pets can be caged by right-clicking and selecting Put In Cage.