Air China uses terminal 3, so...
Nanjing → Beijing → Milan
Your luggage will be checked all the way through. Even though you're technically leaving China from Beijing, you don't need to have your checked luggage with you to go through the departure customs procedure.
Source: Beijing Airport Domestic to International, personal experience
Milan → Beijing → Nanjing
Your luggage will not be checked all the way through. Since you're officially entering China in Beijing, you'll go through customs in Beijing. So you'll be picking up your luggage as an international arrival (from Milan) and then recheck your luggage as a domestic departure (to Nanjing).
Source: Beijing Airport International to Domestic, personal experience