How do you get an "A" rank in a quest and what are the other ranks besides "S"?

You can get all the way down to D. You honestly have to try really hard to do that though. Every rank has its own little jingle and color. If you want to see all of them, I'd recommend finding a mission that requires doing it within a certain time limit. Because each rank is statically placed at certain time markers.