In the early days, individual songs could be released as singles, and LPs (long play) were released as entire albums. That's why albums are the length they are: it represents the number of songs one can comfortably fit on an LP.
LPs and singles were originally in competition with each other. The smaller single records played at 45 rpm (revolutions per minute), while the longer LPs played at 33 rpm.
EPs, or "extended play" albums were developed as a means of competing with LPs. They ran longer than singles, but still used the 45 rpm format.
Because EPs turn on the record player more quickly than LPs, they don't run as long. The usually hold between four and six songs totaling anywhere from 15 to 30 minutes.
Because EPs were an accepted format for so long--most notably in the UK--they continued after technology rendered the practical need for them obsolete. CDs, for example, could be released in EP format, even though they could hold many more songs on the disc.