Third return of
C_PetJournal.GetPetInfoByPetID().
Lua Code:
local _, _, level = C_PetJournal.GetPetInfoByPetID( C_PetJournal.GetSummonedPetGUID() )
This only works for your current summoned pet. The API does not support getting info from other player's pets, you'll have to scrape their tooltip for their level.