The 2nd-level Sor/Wiz spell levitate [trans] (Player's Handbook 248), in part, says
Levitate allows you to move yourself, another creature, or an object up and down as you wish. A creature must be willing to be levitated, and an object must be unattended or possessed by a willing creature. You can mentally direct the recipient to move up or down as much as 20 feet each round; doing so is a move action. You cannot move the recipient horizontally, but the recipient could clamber along the face of a cliff, for example, or push against a ceiling to move laterally (generally at half its base land speed).
Can a Medium creature that's grappled by a Medium opponent be automatically liberated from the grapple by using on itself a levitation effect or by having an ally use on it a levitation effect?
Note: A low-level totemist that's fond of riding animals is deciding whether to bind to his totem chakra the Magic of Incarnum soulmeld blink shirt (60) that allows the wearer to use an effect like dimension door except only on himself or the Dragon #350 soulmeld gravorg tail (87) that allows the wearer to use an effect like the spell levitate except that it can affect all allies within 10 ft. of the totemist and that subjects can be levitated 20 ft. (+10 ft./essentia) per round. Sure, the totemist likes himself alive, but he likes himself and his mount alive, too! Note that I'm aware that the levitate effect, if possible, will likely provoke attacks of opportunity from the grappler for leaving its threatened area, but, y'know, that's what the feat Mounted Combat is for. Also, I'm aware of this inconclusive 2013 Pathfinder thread on this topic that, while for a different system (with substantially different grappling rules!), might nonetheless provide respondents with food for thought.