After one of the longest trials in West German history, a West Berlin court sentenced six left-wing extremists to jail terms of up to 15 years for their role in the abduction of conservative politician Peter Lorenz in February 1975. The trial, which lasted 2 1/2 years, ranked as the most important of its kind since leaders of the Baader- Meinhof urban guerrilla group were convicted in Stuttgart three years ago. Nearly 400 witnesses and experts gave evidence. Mr. Lorenz was held for six days before being exchanged for five West German extremists who were freed from jail and flown to South Yeman. It was the only kidnapping by West German urban guerrillas to achieve its goal.