I am an American citizen traveling to London for a summer program that I will be getting a student visa stamp for upon arrival. After the monthlong program, I plan on traveling to Italy then maybe to Germany and then maybe back to Italy, then flying from Italy back to the United States. Do I need to know the dates I will be leaving or does it not matter? Also, will there be any problems with entering the European Union directly after completing my course?
You do not need to know the dates in advance (as long as you do not stay beyond your permitted dates). The UK and the Schengen area (which is most of the rest of Europe) have different immigration policies and the visas are different.
For the UK, your student visa stamp allows you to study in the country for some length of time (presumably this is enough time for your stay there).
For the Schengen area, as a US citizen you are permitted to stay without requiring a visa in advance, for up to 90 days combined in all Schengen countries (this certainly includes Italy and Germany). There are more details, but that only matters if you plan to return to Europe within 180 days of your first entry.
See Visa policies in the European Union for full information.