You must enter the port of entry in the country where you applied. You can exit from anywhere. There are exceptions: If you applied for Schengen in Slovenia, you can actually fly to Zagreb in Croatia without a visa for Croatia as they will accept your Schengen visa. (True for Russian and Chinese visitors – first hand experience) but always check.
A Schengen Visa allows you to enter and exit the Schengen area through any port of entry. It does not have to be in the country where you applied for your visa.
So if you got your Visa from Italy you can arrive eg. in Germany and leave from France. No problem.
However, there are certain rules you must observe. One of those rules is that you must apply for your Schengen visa at the country that is your main destination. This rule exists to spread the work load and avoid visa shopping. The main destination is the country where you spend most time in, or if you spend equal time in two countries, the first one of those two.
When you arrive at the border they may ask to see your travel itinerary, including confirmations of flights and hotels. If it turns out that your itinerary is very different from the one you supplied when applying that may be a ground for refusing entry. Since you applied to Italy I assume you gave them an itinerary that made Italy the main destination. I suggest you stick to that itinerary.
Credit:stackoverflow.com‘