She worked for ten years or she had been working for ten years. - both these are correct but mean slightly different things.
She worked for 10 years = she worked for 10 years and now she doesn't work any more.
She had been working for 10 years = she worked for 10 years then something happened eg. She had been working for 10 years before she had a baby. She had been working for 10 years as a waitress before she got a job as a chef.
"Had been" is used to talk about something in the past that happened BEFORE something else in the past.