You can easily determine if you have a hardware or software issue. A reliable method to confirm a screen or other hardware fault is to take a screenshot when the fault is evident - and then review the captured screenshot image...
When reviewed, if the line is not present in the screenshot image, then you have demonstrated that you have a hardware fault that, sooner or later, may become sufficiently severe that repair or replacement of the iPad are the only options. If the lines are visible in the screenshot, the something other than hardware will be the cause.
Note: When reviewing the image, rotating the iPad screen orientation by 90°, from Portrait to Landscape, will ensure that the image does not coincide with screen defects if present.
Take a screenshot on your iPad – Apple Support
If the test indicates that a hardware fault, a visit to the Genius Bar at your local Apple Store is recommended - where the technicians will be able to test and assess your iPad. This will likely inform your next steps:
Genius Bar Reservation and Apple Support Options - Apple
For practical purposes, in lieu of repairing and returning your own iPad, Apple usually exchange the iPad for a renewed/refurbished iPad of the same model and specification. The cost of the exchange is the same as would otherwise be charged for repair. Unless you have benefit of an active AppleCare plan, an out-of-warranty repair while expensive will be somewhat less than the cost of a replacement iPad.
As for out-of-warranty repair costs, Apple offers a fixed-price price repair. You can verify eligibility and cost for your region/country here:
iPad Repair & Service - Apple Support
If you have an active AppleCare+ plan, the cost of repair is reduced to a small excess/deductible fee.