Oil heir Gordon Getty filed suit against federal regulators yesterday to block the government from selling ailing National Permanent Bank, the District's second-largest thrift institution, to Citicorp.

The suit asks the U.S. Court of Appeals for the District of Columbia to halt action on the government's decision last week to sell the thrift to Citicorp and to require that Getty get a chance to raise his bid.

The Federal Home Loan Bank Board, the federal agency that regulates and insures the nation's thrifts, put National Permanent up for sale in January to find a buyer who could restore it to financial health. In the next several months, both Citicorp and Getty bid for the thrift.

The board Thursday denied Getty's request to reverse the agency's decision to sell the thrift to Citicorp.

The thrift had assets of $1.1 billion at the end of 1985 but its liabilities were $80 million higher.

Last week, the bank board awarded National Permanent to Citicorp, the nation's largest bank holding company, and threw in $51.8 million in cash to compensate the bank company for taking over the sick thrift. The deal awaits Federal Reserve Board approval, which would not occur before early July.

Several National Permanent employes said that Citicorp has told them it plans to take over July 8 and replace National Permanent President and Chief Executive Stuart A. McFarland with Citicorp Vice President Thomas Gaspard.

Citicorp had no comment on the lawsuit or on when it might take over the thrift.

Getty's suit claims that his bid falls within 15 percent or $15 million of Citicorp's bid. Federal law, Getty argues, requires that any local bidder whose offer falls within that range be given a chance to rebid and raise the value of the offer.

Federal law also requires the bank board to give preference to bidders who demand the least amount of federal assistance, to preserve the distinction between S&Ls and banks whenever possible and to give preference to local bidders.

Getty, the son of oil tycoon J. Paul Getty and a resident of San Francisco, argues that individual bidders such as himself are, for bidding purposes, considered to be local and thus must be given preference over out-of-state institutions such as Citicorp.

In an sworn statement to the court, Getty's attorney, Robert W. Mehle, said that bank board officials reiterated that policy Jan. 30 during a conference for prospective bidders for National Permanent.

The lawsuit said bank board officials "implied" Getty would win the bid. But the board turned in Citicorp's favor when the New York bank company promised to run National Permanent as a thrift rather than convert it into a bank, as originally proposed, the suit says.

The bank board would not comment on the suit. But in a letter to Getty Friday refusing to allow him another bid, the bank board said it chose Citicorp in "compliance with all applicable legal requirements" and that Citicorp's bid would be the least costly to the government.

The lawsuit is the latest skirmish in the battle between Citicorp and Getty over National Permanent. The pair are fighting for the thrift because it would provide entry into one of the nation's fastest-growing banking markets at a fire-sale price.

The war could be a long one: Citicorp and Getty both have plenty of money to wage court fights and wait out the other. The fragile financial condition of National Permanent, however, is sure to prod lawmakers and regulators to seek a quick resolution, all sides agree.