I do concur with DavidM; it is a good rule of thumb if you think of “gracioso” as funny and “divertido” as fun.
Jane is a funny girl, but Mary is a fun girl.
Jane es una chica graciosa, pero Mary es una chica divertida.
I guess Gracioso is used to describe something comical while Divertido is used to describe something that gives you a good time.
Hope this helps!