It depends on what type of computer you have, the age of it and also the issue you may be having. Lots of times the issue can be fixed relatively easy.
If a laptop repair costs more than half the cost of what you paid for your laptop you may want to think about buying a new one.
If its a MacBook its up to you as replacement parts can be relatively expensive because of the difficulty in acquiring replacement parts and also quality of Mac products.
You would need to get a diagnosis of your issue before coming to a decision as it could be something thats relatively easy and low cost to fix.