To attain is to achieve; accomplish; reach a certain level or goal: The knowledge attained in such disciplines will be useful for the rest of your life.
To obtain is to get possession of something—often something material: A lease with an option to buy is not hard to obtain.