The Megillah (Esther 9:20-22) says that the Jews prevailed over their enemies on the 13th of Adar, and on the 14th they feasted to celebrate the victory. But in Shushan the capital, the battle lasted another day and the holiday was not celebrated until the 15th.
When the Sages instituted Purim, they took into account that Shushan was a walled city, and made the following stipulation: While most cities celebrate Purim on the 14th of Adar, cities which were walled at the time of Joshua (Yehoshua Bin Nun) should celebrate a special Purim -- called "Shushan Purim" -- on the 15th of Adar.
(The Sages originally considered making Shushan Purim conditional on whether a city was walled from the time of Achashverosh -- because the victory occurred at that time. However, as not to honor a Persian city more than the Land of Israel, which was in ruins at the time of the Purim miracle, the Sages made "Purim on the 15th" conditional on cities walled from the time of Joshua.)
The only city that was definitely walled at time of Joshua is Jerusalem.
For a number of other cities in Israel -- such as Jaffa, Akko, Hebron -- there is a doubt whether they were surrounded by walls at the time of Joshua. (Tiberias, though it was likely a walled city at the time of Joshua, nevertheless has doubtful status because there were really only three walls plus the sea.) Such cities celebrate Purim on the 14th, and have an additional Megillah reading on the 15th as a stringency. Therefore, they do not recite the blessings when reading on the 15th.
What Day to Observe?
In Jerusalem, suburbs and towns from which the Old City walls can be seen also observe Shushan Purim. Towns and suburbs less than one kilometer from the walls also observe Shushan Purim, even though they may not be able to see the city.
If a resident of Tel Aviv (unwalled) will be in Jerusalem (walled) on the 14th of Adar, and his intention is to return to Tel Aviv before daybreak on the 15th (or according to the Chazon Ish, at nightfall of the 15th), he reads the Megillah on the 14th -- even if he was inadvertently delayed in Jerusalem. If he intended to stay in Jerusalem until the day of the 15th, he reads on the 15th only.
Similarly, a resident of Jerusalem who will be in Tel Aviv and whose intention was to return to Jerusalem before daybreak of the 14th, reads on the 15th -- even if he is detained in Tel Aviv. If his intention was to be in Tel Aviv on the 14th, he reads on the 14th. And if he returns to Jerusalem on the 15th, he reads again on the 15th.
Shushan Purim on Shabbat
In a case where the 15th of Adar falls on Shabbat, then Shushan Purim is celebrated over a three-day period (Purim mishulash), with different parts of the holiday being distributed as follows:
Megillah Reading: The Sages prohibited reading the Megillah on Shabbat, in order that the scroll not be inadvertently carried in the public domain, which is a violation of Shabbat. The reading of the Megillah is therefore advanced to Friday. It is not postponed to Sunday, like other Rabbinical decrees such as the fast of Tisha B'Av, because the Megillah itself says: "And it shall not pass without being fulfilled, the days of Purim at their proper time and in their proper way" (Esther 9:27). This means we are not allowed to have Purim pass without reading the Megillah, but we are allowed to do so earlier if necessary.
Matanot L'evyonim: Monetary gifts to the poor are also moved earlier to the 14th (Friday) for three reasons: (1) in order that the poor might enjoy their gifts as early as possible; (2) so they'll have provisions for Shabbat; (3) they are accustomed to receiving such gifts on the day which the Megillah is read -- thus when the Megillah is read early, they receive their gifts early as well.
Shabbat Day: On the 15th, which is the actual day of Shushan Purim, the paragraph of "Al Hanisim" is added to the prayer service and to the Grace After Meals. Also, a second Torah scroll is included in the morning Torah reading. The story of the attack of Amalek (Exodus 17:8-16), which is the Torah reading for Purim, is read in addition to the regular weekly parsha. The Haftorah is the same as for Parshat Zachor.
Mishloach Manot: On the 16th (Sunday), gifts of food between friends are exchanged, and the festive Purim meal (Seudah) is eaten. Nevertheless, it is customary to send out a few Mishloach Manot gifts on Friday, while reserving the bulk for Sunday. Additionally, many authorities hold that some Mishloach Manot should be given on Shabbat -- by sending parts of the Shabbat meal to friends.
The festive meal could theoretically be eaten on Shabbat, but it is postponed until Sunday based on the principle that we do not mix two celebrations -- in this case, the Shabbat meal and the Purim meal. However, it is customary to make the Shabbat meal somewhat more elaborate than usual, in honor of Purim.