Players usually have 1-2 hours before the match to get ready psychologically and may choose to listen music. They wear them while walking into stadium, does their pregame warmups and even afterwards as they get ready to leave the stadium.
Well, there are a few reasons why footballers wear headphones when they arrive at the stadium or even they down from their team bus.
However, you might also notice that most of the times they wear huge headphones rather that earphones.
1: They want to be focused before their match, they want to keep themselves calm.
2: They wear headphones so as to avoid any disturbances around them like press interviews or noisy fans.