The terms stern and aft are both used to describe the rear end of a ship. However, there is a slight difference between the two terms. Stern refers to the very back of the ship, while aft can be used to describe any area near the back of the ship.
Aft is actually an abbreviation for after, meaning that it is located after (towards the back of) the midship section. So technically speaking, anything past the midship section can be considered aft. The stern, on the other hand, specifically refers to the very back of the ship where the rudder is located.
If you were standing at the stern looking towards the bow (front) of the ship, everything behind you would be considered aft. Similarly, if you were standing in any other part of the ship and looked towards either side or towards stern, anything behind you would also be considered aft. So in general, anything near or at back of a vessel can be referred to as being aft whereas stern specifically refers to very rear end portion of a vessel.