Blood test

When is it necessary to take a blood test for pregnancy?