The appropriate time?!

When is the appropriate time to tell friends and family your pregnant? 
Like how far along should you be? Just in case something goes wrong