A major development of 345 homes near two Teesside towns has been given the go-ahead.