Winchester is a tourist destination, but it also accommodates some of the cruise ship trade. When the ships are in port, hotel rooms sell out in Southampton. People also book into Winchester hotels as well. If you are planning to stay overnight, then take care to book well ahead.
Winchester itself has lots of lovely hotels and B and Bs. Here is Visit Winchester‘s advice page.
You could also stay in Southampton and travel by train. There is a Premier Inn at the airport itself and all trains stop at Southampton Airport Parkway train station. There are also lots of hotels near to Southampton Central Station. They tend to cater to the cruise ship trade. They have lots of rooms but are very functional and get booked up quickly.
There are also smaller railway stations near to Winchester. The trains are not necessarily frequent. Eastleigh is between Winchester and Southampton airport, but not all trains stop there. Eastleigh is a functional town originally developed due to the railways. It is not a tourist location but there are some places to stay.