Southland Corp., operator of 7-Eleven convenience stores, yesterday agreed to purchase Occidental Petroleum Corp.'s refining, marketing and transportation unit of Cities Services Corp. for more than $800 million.

Southland will spend about $575 million in cash: $310 million for certain refined products and merchandise, including total or partial ownership of 16,000 miles of crude-oil and refined-product pipelines and 32 refined-product terminals, $190 million for a crude-oil inventory and $25 million on miscellaneous items. It also will acquire a wholesaling operation that supplies gasoline to 4,000 outlets and aviation fuel to a number of major airlines, and Citco's retailing business, which includes 350 Quik Mart gasoline-convenience stores.

Southland has spent almost $50 million since mid-May to complete projects started by Occidental. The company will invest another $110 million to finish the projects, which should allow the refinery to produce a higher grade of oil and use heavy sour crude, which sells for about $6 to $8 a barrel less than the normally used sweet crude, according to Henry Stanley, vice president of investor relations for Southland. The final figure rises to $800 million after Southland adds $125 million for working capital.

Southland, which runs the largest chain of convenience stores in the country, was already ranked as the largest independent gasoline marketer before the deal. Occidental acquired Cities Services Corp., the nation's eighth-largest oil company, in December 1981 in a deal valued at $4 billion.

Under the deal, Occidental will buy about 20 percent of Southland stock. Southland will issue about 9.3 million new common shares, valued at $415 million. Southland stock closed yesterday at 45 1/4, up 5/8.

Occidental Chairman Armand Hammer will be nominated as a director of Southland at a special meeting of Southland shareholders Aug. 30. Occidental also is expected to gain almost $200 million on the sale of inventories to third parties.