Rhythm is the division of music into recurring pulses of great stress and little stress. Basically, rhythm is akin to syllables in a language, although they typically fall into a regular structure among the dimension of time. Rhythm is one of the three major points of music: rhythm, melody, and harmony.
Rhythm was discovered in the Renaissance (it existed before, of course, but the musical notation before that did not notate it). After that, with each 'generation' of music (Renaissance, Baroque, Classical, etc.), new rules were established and different tastes in rhythm were created.
The basic unit of rhythm is the beat. There are smaller units and there are larger units, of course. Beats are grouped into measures, and further grouped into sections. The amount of beats per measure is indicated by the time signature. The top number indicates the amount of beats and the bottom number indicates what duration takes the beat.
Beats are not really what a song is divided into. Rather, songs are divided into rhythmic structures, which are notes of various durations that may or may not be divided into a beat (they may be larger or smaller). This creates a 'driving force' of the song, and the melody rarely strays rhythmically from the rhythmic structure.
Rhythm is also the part of a song that houses the percussion, and to a lesser extent, riffs and simple melodies. Basically, drums and other percussion instruments are considered to be 'rhythm' unless they compose the melody line. Also, 'stabs', like pizzicato strings and sometimes organs, are sometimes considered rhythm although they may contain chordal (harmonic) information in the song.
In addition, rapping can usually be considered both melody and rhythm, as can scratching, and even the percussion on some Drill 'n' Bass and IDM, as the percussion is often pitched and is sometimes the main part of a song.