Answer: 3 socks
Reason:
You could get lucky to pull out 2 blue socks or 2 black socks in a row. But you could also get unlucky to have 1 blue + 1 black, or the other way around.
That third sock selected will guarantee you picked at least 2 of the same color. This is simply because there aren't any other colors left to pick from.
For more information, check out the Pigeonhole Principle.