It depends. Usually, they will pick up at least some of the language (basic) if not become totally fluent, but sometimes you get players who, for one reason or other, never bother to lean. My guess is that it depends on mental and hidden stats - things like determination, professionalism etc, but I can't say for sure.
I'm reasonably sure they will learn it quicker if there is someone who already speaks the language. It's all part of the settling in process and you will often get press conference questions along the lines of 'You have Player X in your squad who already speaks French, will this help Player Y blend into the team?'
When I was a manager of Racing Club, I brought Vladimir Yurchenko from Belarus as a free agent...and I though that a player that speaks russian was going to have a hard time learning spanish. But no, he learned spanish normally and he was a great addition to the team too.