To show degrees of ability, we can use modal verbs. These show:
1. ability or opportunity in the present
She can play the piano.
She is able to play the piano.
2. ability or opportunity in the past
She could play the piano.
She was able to play the piano.
3. ability in the future:
He could easily do your job given the opportunity.
I will never be able to lift that cupboard alone.
To show ability in the present we use can or be able to often with verbs of perception. N.B. In most cases be able to is more formal than can.
I can hear him but I cannot see him.
I am able to hear him but I am not able to see him.
When we talk about ability in the past the choice between could or was/were able to takes on an extra meaning.
I could leave.
I was able to leave.
Both examples say that I had the opportunity or ability to leave, but could implies I did not leave while was able to implies I did leave.
When we talk about a real past action we use was/were able to and when we talk about a hypothetical course of action we us could.
When we talk about a skill, could and was/were able to are interchangeable.
I could swim when I was four.
I was able to swim when I was four.
Note that in conditional sentences could and be able to are also interchangeable.
In questions, can and could are requests, with could being slightly more formal, while be able to asks about actual ability.
Can you open the window?
Could you open the window?
Are you able to open the window?