How long should one wait for a report before asking about its status? I apologize if this question is too soft or if its answers would be too subjective for this site. However, I would find it highly useful to have such a question answered on this site, and I believe that others might feel this way, too.
I have certainly found a related question (see 13 months and not even one report. what would you do?) quite helpful.
My question is essentially already stated in the title. When submitting a paper, there is obvisouly some time that one simply has to wait patiently. Although I have experienced this a few times by now, I am still completely clueless about the etiquette in this case.
After how many months (or years?) do you think it is appropriate to write to the editor and kindly ask about the status of the paper?
 A: In this version, a PS has been added.
Generally speaking, the answer to the question is principally "journal-dependent" and "editor-dependent". A journal may have a policy of demanding a referee report within $x$ months (where $x$ usually, but not always, varies between 2 to 6 months in my experience), but this policy may not be faithfully implemented by an editor who is not sufficiently strict or conscientious.
Other factors that can considerably delay the refereeing process include: 
(1) the length of the paper, and 
(2) the "esoteric" nature of the paper (as viewed by the editor). In such cases it might take a while (e.g. several months) for the editor to find an appropriate expert who is willing to serve as a referee.

Based on the above considerations, my advice to young mathematicians is to explicitly ask the editor in charge of your paper for an approximate time-frame for the completion of the review process (ideally, shortly after the journal has acknowledged receipt of the paper). Then, if you have not heard back from the journal within the expected time-frame, make a (gentle) inquiry about the status of your paper to the editor. 

PS. Some of the comments to my answer found the idea of contacting the editor to gain information about the time-frame of the refereeing process to be unrealistic and/or improper. My answer was not meant to ask authors to force editors into promises they may not be able to keep, or to encourage authors to pester editors. However, I wish to point out that an editor always has the option to offer a very general time-frame based on his/her own experience (e.g. "usually 6 to 12 months, but in the case of your paper it might be longer because of $x$, $y$, or $z$").  To conclude: those of use who have served as editors and referees know that once in a while some "nudging" is necessary, albeit with utmost politeness, and with sympathy to the thankless plight of both editors and referees.
A: As others have mentioned, possible parameters are too wide for a one-size-fits-all answer. But here are some data points:


*

*My personal default is to wait six months before inquiring into a paper's status. In other words, I have decided that not hearing anything in six months is pretty much never a surprising turn of events to me.

*For a long paper (say over 40 pages), I might extend this somewhat, but probably not longer than nine months. For a very short paper (say under 8 pages), I might inquire at four months; but knowing me, I'd probably just wait until six months anyway.

*Surely these durations can be decreased if one is in the position where a paper accepted or not will have a significant impact upon one's career. I think it's reasonable to write after three months, politely ask about the status of the paper, and add that you're going on the job market at time X and would be very grateful to know the decision on the paper by then.

*Above all else, word your inquiry with the understanding that both the editors and referees are volunteering their time. Authors have the right to a timely evaluation of their paper (that comes with the agreement not to submit elsewhere while it's being evaluated), and sometimes the editors/referees just need a gentle nudge to notice that it's been a long time. But (needless to say) implying malice, laziness, or incompetence is extremely unlikely to make anything better. (Even if it's the third time around asking about a paper, when those nouns probably do in fact apply!)

