Tesla, which is an electric car maker, has confirmed that it will discontinue the Model S and Model X by next quarter, marking the end of two vehicles that helped define the brand in its early years.