You need to measure the width of the distance between the rear dropouts. I shall assume the cassette you bought is Shimano compatible; and I shall assume you want to retain the same rim size, else you might have to change your brakes.
If it is 135mm which is likely, you need a rear wheel with a Shimano compatible mtb hub. If it is 130mm, you need a rear wheel with a Shimano compatible road hub. Either way you need a
3mm spacer since modern hubs are 8/9/10 speed and are wider than what they used for 7 speed cassettes. 7 speed freehubs are no longer made.
If it is 126mm, options depend on whether your frame is steel or alloy.