In a nutshell, the GMAT is taken by students planning to get an MBA or a masters in another business/management track. GREs are taken by students planning to do graduate work in other fields like psychology, education, etc.
The purpose of GRE and GMAT is to measure the ability of students in 2 different ways. One specifically designed if the students aptitude will be Business oriented or technical knowledge based. Questions are designed to bring out the students personality and knowledge. Visit http://www.happyschoolsblog.com for more details on GRE.