Welcome. Several issues at play here.
Your present 6 speed rear will likely have 126mm hub spacing. A 9 speed will have 130mm spacing, so no, they are not compatible.
If you were to replace the wheel with a hub that has 130mm spacing, you'd also need to replace the 6 speed shifter to a 9 speed.
Are you looking to 9 speed to get higher or lower gearing, or simply more gears? Higher or lower gearing might be accomplished by a different freewheel than your current 6 speed. That's where I'd start.