In PC Minecraft it's left shift. In Minecraft PE it's "sneak," which is double tapping the center button of the D pad.
Here's a hilarious click bait article on the subject:
www.goplay.com/article/how-to-get-off-horse-in-minecraft-pe-pc-dismount-horse-guide-1639.html