In order for this magic to happen, basically three things need to be present:
- A link from the "content page" to the "author page" which contains the rel="author" parameter.
- A link from the "author page" to a Google profile which also contains the &rel=author query parameter.
- A link on the Google profile back to the website hosting those pages.
(Step 1 is omitted from Paŭlo's answer, but it shouldn't be -- without the link from the content page, this feature would only work on the author's page itself, not on any answers that that user actually wrote. That's not the intent of the feature, and it also wouldn't be that useful for anyone. The only time your Stack Overflow author page would come up in a search result is if you were already searching for that person anyway).
Steps 2 and 3 are already under the control of any Stack Exchange user -- however, Stack Overflow has to decide if it wants to take Step 1 (and enable step 2).
For the same reasons that Stack Overflow adds
nofollow by default to outbound links from user pages, I don't think the author link should happen automatically for everyone. It should be a tool used to incentivize answer-ers. For example, ref="author" could be automatically added to the link to the answerer's profile on the accepted answer of a question, if the answerer has over 2,000 reputation. It would certainly incentivize having accepted answers (over votes) even more. I can also see people being more vigilant with keeping an answer up-to-date if their name is on the search result. Not to mention, search results with authors pop out more on the Google results page, and I wouldn't be surprised if (now or in the future) those results get some extra Google Juice of their own.
On the other hand, if someone does not want to have their name associated this way, it's incredibly easy to do: just don't include a link to Stack Overflow on your Google profile, or a link to your Google profile on your SO author page. It's explicitly opt-in and nearly impossible to achieve by accident, so there's no privacy concerns.
Adapted this answer from my duplicate question on this topic.