You have 2 problems,
1. Power supply unit in your PC is rated to output low wattage, this might be a problem when upgrading some components to those that draw more power. A 1050ti may work on your PC, you could order one, try it (i'm sure it'll boot), the problem would be when you game and put your system under load, If that power supply has weak quality build / or / your system starves for power, you'll get a restart. So then you can buy yourself a better power supply (like I said, about 30-60$ will be enough for a new one). [the r7 240 graphics card is fairly close to a gtx1050ti non 6 pin power draw, so it's worth a try in that sense]
2. being that you don't know about external power connectors for video cards. These come from power supplies, they are called 6pin connectors (by most people). All of PSUs have it today (maybe not a 10$ PSU... but not gonna involve that). So you would have to buy a graphics card that does not require a 6pin connector (only lower end cards do not require extra connectors. GTX1050 has a mix of some requiring and others not, because it is a low power draw card, but when they are overclocked, they sometimes surpass the limit of what the motherboard can feed to the card), this would be specified in the technical details of a graphics card (need to do some looking). I do think there are 1050ti with no extra power needed, but I may be wrong, need to check.
Any graphics card that is on a higher tier (like your 980ti suggestion), will automatically need you to upgrade your power supply. I would personally just go ahead and upgrade the power supply and get yourself a decent GPU, your i7 will still game pretty good for a 2-3 more years, might as well make use of what it's got to offer.