Guarulhos is not in a "good" area, but nothing so bad as implied by djjaguar64 comment. Having said that, there is not really much to do around GRU.
Your best bets are, in my opinion:
- Go to São Paulo. You can expect to expend some 3-4hs in the city.
- There is a day hotel inside GRU: FastSleep. They rent their rooms by the hour. You can go there, have a shower, get some sleep.
- My choice: go to TAM check-in and ask if it would be possible to put you on an earlier flight. They usually do it without charge, if seats are avaiable.