Protic solvents affect nucleophilicity because they form a shell around the nucleophile via their hydrogen which has a positive partial charge and therefore interacts with it, thus the nucleophilicity will decrease. This effect is stronger for smaller nucleophiles as they can be "trapped" more easily. So taking the classical nucleophiles you obtain this order:
$$\ce{I^-} > \ce{Br^-} > \ce{Cl^-} > \ce{F^-}$$
Aprotic solvents affect nucleophilicity in a more complex way. You can sometimes read that the previous order of nucleophile strength is inversed and small nucleophiles are favored:
$$\ce{F^-} > \ce{Cl^-} > \ce{Br^-} > \ce{I^-}$$
But be careful, this is not always true. There is more consideration to take.
- A "soft" anion is highly polarizable and has more electron density to give, making it a good nucleophile compared to "hard" ones which are tightly holding their electrons.
- This order is not respected by some polar aprotic solvents, acetone is the only one coming in my mind.