The word diary comes from the Latin word diarium ("daily allowance", from dies, "day" - more often in the plural form diaria). The word "journal" comes from the same root (diurnus = of the day) through "journey".
Sales of "page a day" diaries go back hundreds of years (Letts, for example, is over 200 years old). At first, most of these books were used as ledgers, or business books. Samuel Pepys is the earliest diarist that is well known today, although he had contemporaries who were also keeping diaries. (John Evelyn for one.) Pepys also was apparently at a turning point in diary history, for he took it beyond mere business transaction notation, into the realm of the personal.
The oldest diaries we have come from Oriental cultures. Pillowbooks of Japanese Court Ladies and Asian travel journals, being some of the oldest surviving specimens of this genre of writing. It does seem that around the turn of the last century, diary writing was for the rich or well off. Most literary figures from that time seem to have kept a diary. (see list below)
In the 1960s Tristine Rainer wrote a book called The New Diary. It was revolutionary in expanding our awareness of diary keeping as a literary genre. In it she identified techniques that people either use spontaneously or have employed in their daily writing to explore themselves and their experience of the world in which they live. The idea, as expressed with the title, being that a diary doesn't have to be a dry recording of weather or daily events.
In the 1980s and 1990s diaries, or journals, have become fertile ground for therapy. Many books have been published about how to write a diary (for self awareness, for finding your true self, for healing from any number of personal troubles). An entire culture has evolved around the practice of journaling. There are many techniques to be attempted. (Many of these techniques enjoyed their first mention in Tristine Rainer's book.)
One of the most tempting things about diaries is that writing one is accessible to anyone with a pen and paper. No education is needed. One doesn't need to know how to spell or use grammar. Writing a diary is something some people are driven to do, often as a way to put their existence into perspective. Too often diaries are perceived to be written only by teenage girls. The onslaught of diaries sold in "cute" colors with locks and keys helped this illusion. (Not sure when those became popular - 1940s or 1950s.) Nowadays, many people prefer the word "journal" so as to avoid this common misconception.
In the years since access to the internet became commonly available, many online diary communities have appeared. Some are personal web logs, also known as blogs. Some communities are small and merely offer a place to store your diary online in a private space, while others have become true communities offering opportunity for feedback and communication with your fellow diarists. Many of the people using these online communities are teenage girls and young people, who perhaps see them as a way to keep their inner thoughts secret from their families, while expressing and exploring their feelings and the experience of growing up. Other people choose to start up a diary in their own private webspace, and to maintain either a public or private record of their lives.
Some websites allow one to create an "online diary" - these include: