For example this two sentences : Nuclear submarines, of course, have an important role in today's Navy. & She received her commission as a lieutenant in the navy today
I don't understand the difference.
Well, one is right and one is wrong (in my opinion) if they're referring to a specific navy, e.g. The United States Navy ... which is Navy for short.
You would use a lowercased navy when you speak in general terms: At that time, the country had the finest navy the world had ever seen.
In your examples, I think it would be Navy in the second case if you're speaking of a particular navy, but lowercased if you're speaking in general, i.e. the navy of some unnamed country (and even then some people might capitalize it).
Here's our dictionary's definition, which is somewhat helpful: navy:
1. the warships and auxiliary vessels of a nation or ruler
2. the navy ⇒ (often capital) the branch of a country's armed services comprising such ships, their crews, and all their supporting services and equipment