It literally wishes the person strength. "May you have strength!"
In short, it means something along the lines of "Good job!" It congratulates someone who has had the merit of performing a mitzvah or some other good Jewish task. Most often, it is said by many people at once when someone has finished giving a Jewish talk (a drash or d'var Torah). It is also said man-to-man with a handshake for those who have fulfilled a mitzvah during a synagogue service, such as reading the Torah, carrying the Torah, or receiving an aliyah. As a practical matter, for synagogue mitzvot, it is normally said to men. Women can certainly wish a man "yasher koach," but there probably wouldn't be a handshake. If you are not shomer negiah, you still shouldn't offer your hand to a man if you don't know whether he is shomer negiah or not. (See The Most-Thought Yet Least-Asked Question: Are you shomer negiah? and Awkward Moments: When You're Not Sure Who's Shomer Negiah.)
An interesting piece on the history of the phrase: From the Sources by Eliezer Segal.