Frequency Management: Staying on and Leaving the Frequency

At controlled aerodromes, you remain on frequency throughout your ground operations and departure. You request to leave the frequency only after airborne and established on your route. An ATC clearance to "leave the frequency" or "no further ATC service" officially ends your communication.
At AFIS and unattended aerodromes, the rules are different. You may leave the frequency at will. You do not need permission. Once you are airborne and established on your desired heading, you may switch to another frequency or change the radio off.
Some student pilots find this confusing. At a controlled field, you are under control and need permission to leave. At an uncontrolled field, you are not under control, so leaving is simply your choice.