The 36 year old had been without a club since leaving Marseille by mutual consent in November after kicking a fan before a Europa League match.
Evra was banned from Uefa competition for the rest of the season but can play in the Premier League for the Hammers.
"It's amazing to be back and I am thankful to West Ham for giving me the opportunity to do my job," he said.
"You don't realise how lucky you are. Just to wake up this morning and know I am going to train with my new team-mates made me smile.
"When you have to make a deal and money is not the issue, the deal could be done in five minutes. It was the fastest thing I have done in my life."