This is called a dateline.
Look at the relevant Wikipedia article for a guide to proper formatting and links to the Wall Street Journal and Associated Press style guides.
Contrary to what the Wikipedia article claims, the dateline does not (necessarily) describe "where and when the story occurred", but where and when the news originated. I have read several newspaper articles where the dateline referred to, for example, an embassy in my country (which became clear from explanations in text), while the actual news took place in the home country of that embassy. Similarly the death of an explorer is often not reported by journalists on site, but relayed through their agents whose offices and press conferences are in turn credited in the dateline.
The origin of the news or feature story, and thus the DATELINE preceding it, is a matter of editorial decision making. It does not arise from a location fixed inevitably at a named locale of given latitude and longitude. The latidude belongs to the editor. Thus where news happens is wherever a news editor decides that the newsworthy situation took place, or where a news-peg could be found. (Grady Clay, Real Places, 1994, p. 15)
Here is an example from a recent article in the New York Times:

As you can read, the event described happened in Bavaria, while the datline gives "Cologne" (not in Bavaria) as the origin of the news. Apparently, when she wrote the story, author Melissa Eddy was still in Cologne for the carnival.
In another example, this one from Reuters, the author reports on events in Brazil from Chicago:

As for the proper formatting (and inclusion) of a dateline, you need to refer to the house style of whoever you are writing for.