"I have been in America for 10 years" indicates that the speaker is still currently in America.
But what if you are not in America anymore and you want to express that you have spent 10 years living in America? Can you say:
I had been in America for 10 years. I was in America for 10 years.
Or are there any other ways to express the same idea?
"I was in America for 10 years" means what you want.
You would use "I had been in America for 10 years" (the past perfect) if you were talking about a particular time in the past, and saying that by that time you had lived there for 10 years. It doesn't rule out the possibility that you continued to live there afterwards (or are still there).
The perfect aspect is used to denote the circumstance of an action's being complete at a certain time. It is expressed using a form of the auxiliary verb have (appropriately conjugated for tense etc.) together with the past participle of the main verb: She has eaten it; We had left; When will you have finished?
Perfect forms can also be used to refer to states or habitual actions, even if not complete, if the focus is on the time period before the point of reference (We had lived there for five years).
As Michael said in the comment, the most common way is:
I lived in America for 10 years.
Or, you can say as you said:
I was in America for 10 years.
I had spent 10 years in America.