Geomagnetism covers questions related to the Earth’s magnetic field, its origin, history and measurement. Use electromagnetism for more general questions on magnetism.
The Earth's field at a given point is a vector quantity, denoted by B. It is usually described by an intensity, the magnitude of the field (measured in microteslas); a declination, the angle between the horizontal field and geographic north; and an inclination or dip, the angle between the field and the horizontal plane.
Earth's magnetic field, also known as the geomagnetic field, is the magnetic field that extends from the Earth's interior out into space, where it meets the solar wind, a stream of charged particles emanating from the Sun. Its magnitude at the Earth's surface ranges from 25 to 65 microteslas. Roughly speaking it is the field of a magnetic dipole currently tilted at an angle of about 11 degrees with respect to Earth's rotational axis, as if there were a bar magnet placed at that angle at the center of the Earth. The North geomagnetic pole, located near Greenland in the northern hemisphere, is actually the south pole of the Earth's magnetic field, and the South geomagnetic pole is the north pole. Earth's magnetic field, unlike that of a bar magnet, changes over time because it is generated by the motion of molten iron alloys in its outer core, a mechanism known as the geodynamo.
While the North and South magnetic poles are usually located near the geographic poles, they wander over geological time scales, but sufficiently slowly for ordinary compasses to remain useful for navigation. However, at irregular intervals averaging several hundred thousand years, the Earth's field reverses and the North and South Magnetic Poles relatively abruptly switch places.
The Earth's field extends several tens of thousands of kilometers into space, protecting the Earth from the charged particles of the solar wind and cosmic rays.
For more information, see this Wikipedia link.