Costly and expensive are two words that are similar in their meanings and are used almost interchangeably. When you say costly you mean to say that is beyond your budget or what you had in mind when you first thought of it. Similarly expensive is used to refer to anything that looks and feels better than ordinary things like expensive watch or expensive wine. Though there is nothing much to choose between these two words, there are subtle differences in their meanings to suggest that they be used in different contexts.
Costly is also used to refer to acts for which one may have to pay dearly later on. For example, if you cross the speed limit on the highway, you may get a ticket which is another way to say that speeding proved costly to you. In this context you cannot use the word expensive. Both costly and expensive are adjectives and refer to things or acts that are something more than common or ordinary.
Take a look at these two examples
It is a costly watch
It is an expensive watch.
Though technically and grammatically both sentences are right and one cannot find fault with the use of either of the two adjectives, somehow expensive rings better than costly which looks awkward with an item like watch. Take a look at this example.
My friend prefers cheap things and says that bottled water is expensive.
I know that buying a lot of expensive bottled water can be costly on your pocket.
For some, costly is just a little more than cheap. Expensive connotes finer things in life and for those who have a finer taste in life, expensive is always better.
In terms of professionals you always use the word costly and you never say that the attorney is expensive. When costly is used in terms of a war, it refers to the cost paid by a nation in terms of its men and resources. You can never say that the war was expensive and it is always a costly war.