According to Apple the Lightning cable can extend up to 2 meters (6.5 feet) and work optimally. You can likely find 3rd party (non-Apple) cables that are longer, however Apple onnly recommends and sells cables up to 2 meters.
Lightning is a proprietary computer bus and power connector, created and designed by Apple Inc. It was introduced on September 12, 2012, in conjunction with the iPhone 5, to replace its predecessor, the 30-pin dock connector. The Lightning connector is used to connect Apple mobile devices like iPhones, iPads, and iPods to host computers, external monitors, cameras, USB battery chargers, and other peripherals. Using 8 pins instead of 30, Lightning is much smaller than its predecessor. The Lightning connector is reversible. The plug is indented on each side to match up with corresponding points inside the receptacle to retain the connection.In 2018, Apple began transitioning to USB-C on iPad Pros and accessories. In response to legislation to standardize charging ports passed in 2022, Apple said it would comply with regulations. The iPhone 15 and 15 Plus (2023), as well as the iPhone 15 Pro and Pro Max, became the first iPhones to transition to USB-C, and the last few Lightning accessories will make the transition by 2025.