The terms "Navy" and "Air Force" refer to distinctly different branches of military service. (The United States also has the Marine Corps, Army, Coast Guard, and Space Force)
Most branches of most militaries operate aircraft of one type or another, either to conduct their primary mission, or for support.
For example, in the United States:
- The Navy and Marine Corps operate ship based aircraft, (fixed and rotary wing) as well as land based.
- The Airforce and Army are exclusively land based.
- The Coast Guard operates helicopters from its ships, plus land based fixed wing transport aircraft.
- The Space Force, well... they are kinda new still and we don't have any Star Wars type craft just yet.
Whether or not a certain airplane operates from ship or shore doesn't change the branch of the military that has ownership and control over the aircraft assigned to it.