Both are traditionally known for displaying More Options
You can think of them as Ellipsis that refer to un-finished menu and hence clicking on it shows you the entire menu, finishing it.
On Android, it is referred to as Overflow Menu
On Apple and iOS devices it is referred to as More Options Menu
Technically these are used to display Secondary options as opposed to Primary ones which are directly displayed in the UI. Overflow Menu options can also contain Destructive actions.
I believe it was made Vertical in Material Design since it drops down rather than showing a horizontal menu with more options, improving User Expectation.