I have only used 浪费 to express waste (time, effort, energy, etc) but recently have come across 白费. It seems to be more a waste on intangible items, but I am having trouble differentiating the two.
The crux is in the 白.
浪费 is similar to squander.
Here’s a good example from Oxford:
squander natural resources
To understand 白 I think it’s best to look at 白白 check out A Chinese-English Dictionary’s definition:
in vain; to no purpose; for nothing
here are two sample sentences they give:
báibái diūdiào yīcì jīhuì
let a chance slip through one’s fingers; miss an opportunity
Bùyào ràng shíguāng báibái guòqu.
Don’t let time slip aimlessly by.
So here we’ve got words like slip, miss, aimlessly and that is really what 白费 is made up of: slip/miss and squander - giving us: to do something in vain, to do something to no avail.
Here are two more examples from AC-ED:
waste of energy; all for nothing; plough the sand
bother one’s head for nothing
白费： you made a lot of efforts but those efforts hadn't take any effect. For example, you have done a lot of work for a project, but in the end the project is cancelled. Those work you have done is 白费了 and no one would use it.
浪费: like the word squander or waste, it conveys that you spend more (time, money, resource, etc) than it's necessary, but those resources might not be fully in vain. For example, you spend 20000 just to buy a small bag, which most of people would think it does not deserve. This is a type of 浪费. Another example is that you spend one hour just to write one word! That's kind of 浪费时间.