It depends upon a number of factors as to whether you also need to retrieve your bags and whether you have to clear Canada Customs and Immigration. Are you on a single ticket and airline (or code share), or are the flights from Mexico to Toronto and Toronto to Boston two separate tickets/airlines? Also, is there an overnight layover? That will make a difference.
If on a single ticket you will normally just follow the "Connections" sign upon landing in Toronto and not have to deal with Canada Customs and Immigration. You will have to go through a more cursory passport control and security with any carry-on luggage and then do US Customs and Immigration pre-clearance, as described by Bizaro86. You will not have to retrieve your checked baggage if it is tagged through to Boston. You will then proceed to your departure gate and land in Boston as a domestic passenger and just retrieve your checked bags and head home.
Here is the connection guide for Toronto Pearson Airport using Air Canada as the airline:
https://www.torontopearson.com/en/connections
(You can also get to the specific web link above from the link in Moonstone's post #4.)
If you have an overnight layover, or your bags cannot be checked straight through to Boston from Puerto Vallarta, then you will need to retrieve your checked bags and clear Canada Customs and Immigration. Then for the second flight you will need to check back in with your bags, clear back through regular security and go through US Customs and Immigration pre-clearance, before heading to your departure gate.