When and where does Attack on Titan take place? Is the setting of "Attack on Titan" (Shingeki no kyojin) supposed to be Earth in the distant future and Titans suddenly appeared out of nowhere and devolved society to medieval level of technology? Or is this just a completely fictional setting?
As @Madara said, Attack on Titan is set on Earth, but in a different situation. This is evidenced by a reference to a real-world legend in episode 15:


   Two captured Titans are named Sawney and Bean, which is stated in-universe to be based on the legend of Sawney Bean.


If we use that same evidence as part of a timeline, there's two possibilities:


The year 850 means that we are at least 850 years following the aforementioned legend, putting us no earlier than year 2350 A.D. This seems possible but unlikely, as their technology shows no signs of being derived from our own.
The year 850 is some marker to an event that happened prior to the legend, in which case we have no frame of reference other than that the story must take place in or after the 1500s. This seems to be the more likely answer.


Keep in mind, though, that in the Attack on Titan universe:


   The oriental races are wiped out; Mikasa has her mother's oriental blood, but is the last surviving member of the Asian races.


With this in mind, it is highly unlikely that it is in Japan or even nearby (though the location is also unstated). However, seeing how many names are European (Jäger is German for "hunter", Armin is a Germanic name, cf. Arminius &amp; Herman), it's most likely that the story takes place in Germany, or at least in Europe, where the remaining survivors of the Titan catastrophe are now cornered.