Things that happen locally occur close to a specific place — near your town, for example. Locally grown tomatoes are picked on nearby farms and sold at your neighborhood market.
If you shop locally, you support your neighbors' businesses whenever possible, buying things that are made and sold in your city or state. If there's been an increase in population locally, it means the total number of people living in your immediate area has gone up. This adverb can also describe things that occur only in one restricted part of the body: "Apply the ointment locally to the itchy spots."