It depends! Depending on the situation, look up music licensing.
Are they getting full exclusive ownership of the track and the ability to use it however they please? For example, could they use it for a game and then use it for something totally unrelated a year later. If so, charge more. I've charged well over $100 for a lengthy track in this case (~2 minute track).
Or are you retaining ownership of the track and licensing it to them? Basically you write up a contract and say, "You can use this song for these projects/uses over the next X years". You can charge less (but don't have to) in this case since you still own the song and could potentially license it again once the contract is up.
Bear in mind, I've written stuff for friends and just charged them a flat rate. A buddy just asked for a death and game over jingle and I'm doing $50 flat since it'll take me an hour or two tops.