Usually employees do this once they have passed the 12 week scan when they will receive their MAT B1 form which they will need to give to the employer. But essentially the employee can tell the employer as soon as they wish.
Further information can also be found at Good Practice: Pregnancy and Maternity.