Gosport is a nightmare to get into and out of at rush hour - so if you end up working round in Portsmouth can add extra to your travel time. Also the quarter area in Gosport isn't that nice an area, know a few people who have had break ins and such like occurring.
Fareham most definitely. Complete nightmare getting in and out of Gosport when its busy (which seems to be most of the time!). Fareham is far more convenient for virtually everything - a major shopping centre, band new multi-screen cinema, large train and bus station, excellent access to the M27, and all with spitting distance of the open countryside (just over Portsdown Hill) and walks around Fareham Creek and the top end of Portsmouth Harbour.
Having lived in Gosport for a few years now, ask for quarters out in Fareham. Better area, quieter unlike the quarters you will most likely get offered near or next to Rowner. However the waiting list for Fareham is some 8 months long, so ask now! Mind there is a decent road next to the Rowner estate which isn't too bad and no break ins, PM me if you want the name of the road and the decent area in fareham!