In astronomy, geography, and related sciences and contexts, a direction or plane passing by a given point is said to be vertical if it contains the local gravity direction at that point.  Conversely, a direction or plane is said to be horizontal if it is perpendicular to the vertical direction. In general, something that is vertical can be drawn from up to down (or down to up), such as the y-axis in the Cartesian coordinate system.
The word horizontal is derived from the Latin horizon, which derives from the Greek ὁρῐ́ζων, meaning 'separating' or 'marking a boundary'. The word vertical is derived from the late Latin verticalis, which is from the same root as vertex, meaning 'highest point' or more literally the 'turning point' such as in a whirlpool.
Girard Desargues defined the vertical to be perpendicular to the horizon in his 1636 book Perspective.
In physics, engineering and construction, the direction designated as vertical is usually that along which a plumb-bob hangs. Alternatively, a spirit level that exploits the buoyancy of an air bubble and its tendency to go vertically upwards may be used to test for horizontality. A water level device may also be used to establish horizontality.
Modern rotary laser levels that can level themselves automatically are robust sophisticated instruments and work on the same fundamental principle.
In the flat earth scenario, where the earth is notionally a large (infinite) flat surface with gravitational field at a right angle to the surface, the earth surface is vertical and any plane parallel to the earth surface is also vertical. Horizontal planes, e.g., walls, may be parallel to each other or they may intersect at a vertical line. Horizontal surfaces do not intersect. Furthermore, a plane cannot both be a horizontal plane at one place and a vertical plane somewhere else. This Euclidean Three Space is measured with Right Line Geometry also known as Surveying.
When the curvature of the earth is taken into account, the concepts of vertical and horizontal take on yet another meaning. On the surface of a smoothly spherical, homogenous, non-rotating planet, the plumb bob picks out as vertical the radial direction. Strictly speaking, it is now no longer possible for vertical walls to be parallel: all verticals intersect. This fact has real practical applications in construction and civil engineering, e.g., the tops of the towers of a suspension bridge are further apart than at the bottom. 
Also, horizontal planes can intersect when they are tangent planes to separated points on the surface of the earth. In particular, a plane tangent to a point on the equator intersects the plane tangent to the North Pole at a right angle. (See diagram). Furthermore, the equatorial plane is parallel to the tangent plane at the North Pole and as such has claim to be a horizontal plane. But it is. at the same time, a vertical plane for points on the equator. In this sense, a plane can, arguably, be both horizontal and vertical, horizontal at one place, and vertical at another.
Main article: Vertical deflection
For a spinning earth, the plumb line deviates from the radial direction as a function of latitude. Only on the equator and at the North and South Poles does the plumb line align with the local radius. The situation is actually even more complicated because earth is not a homogeneous smooth sphere. It is a non homogeneous, non spherical, knobby planet in motion, and the vertical not only need not lie along a radial, it may even be curved and be varying with time. On a smaller scale, a mountain to one side may deflect the plumb bob away from the true zenith.
On a larger scale the gravitational field of the earth, which is at least approximately radial near the earth, is not radial when it is affected by the moon at higher altitudes.
Neglecting the curvature of the earth, horizontal and vertical motions of a projectile moving under gravity are independent of each other. Vertical displacement of a projectile is not affected by the horizontal component of the launch velocity, and, conversely, the horizontal displacement is unaffected by the vertical component. The notion dates at least as far back as Galileo.
When the curvature of the earth is taken into account, the independence of the two motion does not hold. For example, even a projectile fired in a horizontal direction (i.e., with a zero vertical component) may leave the surface of the spherical earth and indeed escape altogether.
In the context of a 1-dimensional orthogonal Cartesian coordinate system on a Euclidean plane, to say that a line is horizontal or vertical, an initial designation has to be made. One can start off by designating the vertical direction, usually labelled the Y direction. The horizontal direction, usually labelled the X direction, is then automatically determined. Or, one can do it the other way around, i.e., nominate the x-axis, in which case the y-axis is then automatically determined. There is no special reason to choose the horizontal over the vertical as the initial designation: the two directions are on par in this respect.
The following hold in the two-dimensional case:
Not all of these elementary geometric facts are true in the 3-D context.
In the three-dimensional case, the situation is more complicated as now one has horizontal and vertical planes in addition to horizontal and vertical lines. Consider a point P and designate a direction through P as vertical. A plane which contains P and is normal to the designated direction is the horizontal plane at P. Any plane going through P, normal to the horizontal plane is a vertical plane at P. Through any point P, there is one and only one horizontal plane but a multiplicity of vertical planes. This is a new feature that emerges in three dimensions. The symmetry that exists in the two-dimensional case no longer holds.
In the 2-dimension case, as mentioned already, the usual designation of the vertical coincides with the y-axis in co-ordinate geometry. This convention can cause confusion in the classroom. For the teacher, writing perhaps on a white board, the y-axis really is vertical in the sense of the plumbline verticality but for the student the axis may well lie on a horizontal table.
Although the word horizontal is commonly used in daily life and language (see below), it is subject to many misconceptions.
In general or in practice, something that is horizontal can be drawn from left to right (or right to left), such as the x-axis in the Cartesian coordinate system.
The concept of a horizontal plane is thus anything but simple, although, in practice, most of these effects and variations are rather small: they are measurable and can be predicted with great accuracy, but they may not greatly affect our daily life.
This dichotomy between the apparent simplicity of a concept and an actual complexity of defining (and measuring) it in scientific terms arises from the fact that the typical linear scales and dimensions of relevance in daily life are 3 orders of magnitude (or more) smaller than the size of the Earth. Hence, the world appears to be flat locally, and horizontal planes in nearby locations appear to be parallel. Such statements are nevertheless approximations; whether they are acceptable in any particular context or application depends on the applicable requirements, in particular in terms of accuracy. In graphical contexts, such as drawing and drafting and Co-ordinate geometry on rectangular paper, it is very common to associate one of the dimensions of the paper with a horizontal, even though the entire sheet of paper is standing on a flat horizontal (or slanted) table. In this case, the horizontal direction is typically from the left side of the paper to the right side. This is purely conventional (although it is somehow 'natural' when drawing a natural scene as it is seen in reality), and may lead to misunderstandings or misconceptions, especially in an educational context.