Semiconductor nanowires with strong Rashba spin-orbit coupling are currently on the spotlight of several research fields such as spintronics, topological materials and quantum computation. While most theoretical models assume an infinitely long nanowire, in actual experimental setups the nanowire has a finite length, is contacted to metallic electrodes and is partly covered by gates. By taking these effects into account through an inhomogeneous spin-orbit coupling profile, we show that in general two types of bound states arise in the nanowire, namely confinement bound states and interface bound states. The appearance of confinement bound states, related to the finite length of the nanowire, is favoured by a mismatch of the bulk band bottoms characterizing the lead and the nanowire, and occurs even in the absence of magnetic field. In contrast, an interface bound states may only appear if a magnetic field applied perpendicularly to the spin-orbit field direction overcomes a critical value, and is favoured by an alignment of the band bottoms of the two regions across the interface. We describe in details the emergence of these two types of bound states, pointing out their differences. Furthermore, we show that when a nanowire portion is covered by a gate the application of a magnetic field can change the nature of the electronic ground state from a confinement to an interface bound state, determining a redistribution of the electron charge.