I know from US ports they need to be out 3 nautical miles to be out of US territorial waters (for cruise ship casinos it's 12 nautical miles). I would assume the same is true from Canada. It used to be 3 nautical miles for everything until new UNCLOS provisions were implemented.
The law is funny though as there are exceptions. When sailing the Alaskan ports where you rarely leave US waters, the rule is 3 miles after leaving port until 3 miles before docking, no matter how close the land is.