A lens with a longer focal length will always have shallower depth of field. So at f4 - both will definitely have a very different amount of blur (the 50mm having much more). You sure have a zoom lens (maybe a kit lens that came with your camera body). Try that at the same f-stop at 24mm and 50mm, and see for yourself.
The much more apparent difference will be the distortion and angle of view though. A 24mm lens renders images very differently than a 50mm lens does.
Regarding bokeh: if you take several different 50mm lenses, they all will roughly render the same amount of background blur at the same f-stop. But the "quality" of the blur will be different. Some are smoother, but others will show the shape of the aperture opening (if it is not completely round).
I see. That's some good news, and I guess it makes the purchase of the 50mm STM worth it, even though I already have the 24mm.
And I actually do not have the kit lens, I got the camera body only and used the money to get my 24mm.
Which type of camera do you have full format or crop? I can make a test image for you if you like.
Oh, that would be nice! I have a SL2, cropped.
OK, here we go. There is nothing fancy going on here at the moment, so the images are not spectacular

.
To explain: my old 400D battery was dead, so I had to use a full frame body and cropped the middle - that would render exactly the same image than shooting from a crop format sensor. The lenses I used were Sigma 50mm F1,4 EX DG HSM (
at f1.8!!!) and Canon 24mm f1.4 LII (
at f2.8!!!) to give you the depth of field of the lenses you are considering or owning. As said above - the bokeh is something different, we are only talking about depth of field and background blur.
Image Nr. 1: 50mm @f1.8 (click to enlarge)
View attachment 150015
Image Nr. 2: 24mm @f2.8
View attachment 150016
Both of the above images were shot from a tripod, same position - only the lens was changed.
To give you an even better idea, I also took a shot with the 24mm and moved closer to the subject so that the crop of the main subject is roughly the same.
Image Nr. 3: 24mm @f2.8 from a closer distance
View attachment 150017
I hope that helps you with you with your decision. Keep in mind that things change when you move your subject or the background:
- the closer your subject is to the camera the more blurred your background
- the further away your background from your subject, the more blurred the background
And here are the other factors that blur the background:
- a wider aperture (lower number): more blur
- a larger sensor (because you move closer to frame the subject): more blur
- a longer focal length: more blur