There's an incredible amount of variety to be found in every borough. Some places are much more family friendly than others. Staten Island is generally considered the best place to raise kids because it's mostly comprised of nice neighborhoods with tidy homes set along tree-lined streets, but there are some pretty seedy areas there too. Saint George, New Brighton, Port Richmond, Mariner's Harbor, Stapleton and Clifton are pretty rough in some places, even if the neighborhoods themselves look all right. Most of the South Shore is okay - Dongan Hills, New Dorp, Bay Terrace, Great Kills, Tottenville, Pleasant Plains, Eltingville, Annadale.
In Brooklyn, there are lots of family-friendly neighborhoods from Bay Ridge, Dyker Heights, Bath Beach and Bensonhurst to Marine Park and Gerritsen Beach. Sheepshead Bay and Mill Basin weren't bad even a few years ago, but I wouldn't want to live there now, still I wouldn't consider them to be particularly dangerous places, just not very desirable. If you have money, Park Slope, Carroll Gardens and Windor terrace are nice, and some parts of Downtown Brooklyn and Brooklyn Heights are nice too, but it really can differ from block to block.
Much of Queens is residential and fairly safe, Astoria and Forest Hills, Bayside and College Point are all okay.
The Bronx doesn't have as many nice areas, there are fewer single-family homes there than in Staten island, Brooklyn or Queens, but Woodlawn, Allerton and Throg's Neck are okay.
In Manhattan there are some very ritzy areas - the Upper West Side, the Upper east Side, Chelsea, SoHo, Greenwich Village, etc., but the nicest area for somebody who isn't rolling in dough would probably be Inwood, which still isn't all that great, so unless you're planning on dropping 10 grand a month on rent or close to it, forget Manhattan.