The first form returns the level of the PC passed as the first argument in the class passed as the second argument. The class must be given as an integer, which can be computed with classint from a class name.
The second form returns the level of a mob.
To get the levels of a PC in array form, you can also use the levels function.