My doctor told me once that when you have the flu you're contagious for up to 7 days when you have the flu.
So you should avoid going to work for at least 8 or 10 days when you have the flu.
The flu will usually go away within seven days but the flu if it's more severe can last for a few weeks.