According to the rules of both the Senate and House of Representatives, committee hearings may be held behind closed doors when they involve matters that could endanger national security, harm an ongoing investigation, cause a deep invasion of an individual's privacy, and a variety of other situations along those lines.
Presumably, the hearings on Ukraine have the potential to meet one these situations, and therefore they are closed as a precaution. It certainly wouldn't be surprising for them to meet the 'national security' and 'ongoing investigation' categories at the very least, according to what is already known about the situation.
The Senate rules can be found here, and the relevant part is in Section XXVI, paragraph 5(b):
Each meeting of a committee, or any subcommittee thereof, including meetings to conduct hearings, shall be open to the public, except that a meeting or series of meetings by a committee or a subcommittee thereof on the same subject for a period of no more than fourteen calendar days may be closed to the public on a motion made and seconded to go into closed session to discuss only whether the matters enumerated in clauses (1) through (6) would require the meeting to be closed, followed immediately by a record vote in open session by a majority of the members of the committee or subcommittee when it is determined that the matters to be discussed or the testimony to be taken at such meeting or meetings
(1) will disclose matters necessary to be kept secret in the interests of national defense or the confidential conduct of the foreign relations of the United States;
(2) will relate solely to matters of committee staff personnel or internal staff management or procedure;
(3) will tend to charge an individual with crime or misconduct, to disgrace or injure the professional standing of an individual, or otherwise to expose an individual to public contempt or obloquy, or will represent a clearly unwarranted invasion of the privacy of an individual;
(4) will disclose the identity of any informer or law enforcement agent or will disclose any information relating to the investigation or prosecution of a criminal offense that is required to be kept secret in the interests of effective law enforcement;
(5) will disclose information relating to the trade secrets of financial or commercial information pertaining specifically to a given person if
The House rules, found here, are similar, and the relevant section can be found on page 572 of the document:
(2)(A) Each hearing conducted by a committee
or subcommittee (other than the Committee on
Ethics or its subcommittees) shall be open to the
public, including to radio, television, and still
photography coverage, except when the committee or subcommittee, in open session and with a majority present, determines by record
vote that all or part of the remainder of that
hearing on that day shall be closed to the public
because disclosure of testimony, evidence, or
other matters to be considered would endanger
national security, would compromise sensitive
law enforcement information, or would violate a
law or rule of the House.