To retain as many of the aromatics from the dry-hopping, you want to add the hops once active fermentation is finished and you've reached terminal gravity; otherwise, the yeast and CO2 will scrub away what you tried to put in.
If there's one thing that homebrewers have the luxury of, it's time. I'm a proponent of a long (3-4 week) primary and eschewing the secondary completely, except when I'm dry-hopping. At a minimum, 10 days from pitching before even thinking about transferring to secondary. Verify this with your hydrometer, then rack the beer onto the hops in secondary. 5-7 days in contact with the dry-hop addition should be perfect.