— Sakurai, Seiya, and Matthew D. Fevergeon. "Door assembly for laminar flow control system." U.S. Patent No. 8,245,976. 21 Aug. 2012. [Current Assignee: Boeing Co.]
Each door is actually one door inside another, so they can open as a scoop, or an outlet (opening fore or aft).
During takeoff the door scoops in air, so higher pressure is created in the cavity behind the pores/holes at the leading edge of the vertical/horizontal stabilizer (shown above), so the pores would be cleaned of any contaminants. With the door open in the other direction, its purpose of boundary layer ingestion works by creating low pressure behind the pores; this drawing in of air at the leading edge "may decrease skin friction drag":
[...] when the first door is moved to the open position, the pores of the laminar flow control system may be purged by high pressure external flow captured by the first door and which may be ducted to the suction cavity for discharge through the pores. The discharge of flow through the pores may effectively remove contaminants such as liquid and/or debris that may be trapped in the pores [...]
When the first door is moved to the closed position and the second door is moved to the open position, a suction force may be generated in the suction cavity [...] the application of the suction force to the porous skin draws a portion of the boundary layer through the pores. As is know in the art, the drawing in or suctioning of the boundary layer may delay transition of the boundary layer to turbulent flow and may decrease skin friction drag.
— Ibid.
Of note, according to a nicely illustrated blog (in French):
[...] the future 787-9 and 787-10 will only be fitted with scoops on the fin and no longer on the horizontal plane, the gain being considered too low.
And, in 2015 the plan to have it on the 777X was dropped (aviationweek.com).
Unpainted system during testing; source: KSBD Photo at flickr.com (annotated)
Related: Why can't commercial aircraft have a wing boundary layer suction system?