As explained at Wikipedia:
"Class D airspace is typically established around any airport with a functioning control tower, but that does not see significant IFR approaches which would make Class B or C more appropriate (usually because there is no scheduled commercial passenger service). Class D airspace generally cylindrical in form and normally extends from the surface to 2,500 feet (760 m) above the ground. The outer radius of the airspace is variable, but is generally 4 nautical miles. Airspace within the given radius, but in surrounding class C or class B airspace, is excluded. Class D airspace reverts to class E or G during hours when the tower is closed, or under other special conditions.[7]
Two-way communication with ATC must be established before entering class D airspace, but no transponder is required. VFR cloud clearance and visibility requirements are the same as class C."
See more details
here.