to express ability (in the sense of being able to do something or knowing how to do something):
He can speak Spanish but he can't write it very well.
to expression permission (in the sense of being allowed or permitted to do something):
Can I talk to my friends in the library waiting room? (Note that can is less formal than may. Also, some writers will object to the use of can in this context.)
to express theoretical possibility:
American automobile makers can make better cars if they think there's a profit in it.
The modal auxiliary could is used... :
to express an ability in the past:
I could always beat you at tennis when we were kids. to express past or future permission:
Could I bury my cat in your back yard?
to express present possibility:
We could always spend the afternoon just sitting around talking.
to express possibility or ability in contingent circumstances:If he studied harder, he could pass this course.
In expressing ability, can and could frequently also imply willingness: Can you help me with my homework?
Can versus May :
Whether the auxiliary verb can can be used to express permission or not — "Can I leave the room now?" ["I don't know if you can, but you may."] — depends on the level of formality of your text or situation. As Theodore Bernstein puts it in The Careful Writer, "a writer who is attentive to the proprieties will preserve the traditional distinction: can for ability or power to do something, may for permission to do it.
The question is at what level can you safely ignore the "proprieties." Merriam-Webster's Dictionary, tenth edition, says the battle is over and can can be used in virtually any situation to express or ask for permission. Most authorities, however, recommend a stricter adherence to the distinction, at least in formal situations.