That's good enough to work for some more years. Clean if needed and you don't need any new motherboard, of course, unless you have physically broken it yourself. The charging problem may be related to temperature, if computer is not clean, but most likely it is related to battery. If Your battery is older than 1 year, then it is old. If You don't want to replace it, You must at least recalibrate. Some batteries lasts couple years, although the remained capacity is small. Usually any battery will lost about 60%-70% of the default capacity in year. The general rule is that any battery lose about 20% -24% of available capacity (of this capacity what it has at that moment) every three months. Capacity loss is faster at the beginning, slower at the end.
Your specs for the DELL XPS laptop are pretty good but perhaps a refurbished Lenova Thinkpad T430 which is widely available quite chaeply on Ebay, Amazon etc. could be a good reflexion for a replacement.
I would look for another laptop I think u will get a better deal and I agree Lenovo is one of he best for your money.
Laptop chargers have only two possible modes - either working or not working. There are no other options. Such a situation not possible, that sometimes works and than again not. And when it stops working, there is nothing to fix and it will never work again. The only thing that can be repaired is the connection cord and plug.
You can wiggle a charger on a failing charger port and sometimes it will randomly work and quit. Although the o.p. should not be doing that, he should get a new charge port and charger (if he thinks this laptop is worth the $$$ to buy those parts)
Thanks for the responses @Joe C, @kaljukass, @jerseyboy and @WindowsGeek. I had another thread in which a poster recommended thermal compounding and clearing out the dust that maybe causing thermal throttling. I was hesitant on doing so and figured that I should buy a new motherboard instead, which is what I mentioned above. I have bumped that thread back up and requested instructions on how one can do that.