What is the proper procedure for leaving class D airspace? So one thing that always struck me as kind of odd was when you depart a class D tower (VFR) and you get your departure instructions, that's kind of ... it. You just go on your merry way and switch off frequency whenever you want to.

Do people just stay on the tower frequency listening until they're outside of the airspace? Or do you give the tower a courtesy call (N123 leaving the class D) when you get to the boundary, and then switch off?

Or, is it legal to switch immediately to another frequency as soon as the tower says 'left turnout approved, resume own navigation'? It always seemed a bit of a hole to me. But, are controllers bothered by a extra "check out" on leaving the class D?
The AIM covers this from an operations / legal standpoint:


  3-2-5. Class D Airspace
  
  
    4. Departures from:
    
    
      (a) A primary or satellite airport with an operating control tower. Two‐way radio communications must be established and maintained with the control tower, and thereafter as instructed by ATC while operating in the Class D airspace. [emphasis mine]
    
  


While operating in Class D airspace, you must maintain two-way radio contact with the tower – monitor the frequency and be prepared to respond. 

You may leave the frequency once you are either clear of the airspace, or receive instructions to that end from ATC ("N1234, frequency change approved").

Whether or not controllers are bothered by you letting them know that you've left, I can't say, but it would probably qualify as frequency congestion. If they want to get in touch with you, they'll try ("N1234, are you still with me?"), but once you're outside the Class D airspace they're generally only providing advisory information.