In my mind-set, it's as follows:
If the vehicle is near it came from the factory it's stock. Meaning that if I replace the door or tires, or other parts that are equivalent to stock in form and/or function, then it's stock. If I replace the side mirrors on my parent's 98 Grand Marquis with ones from a 99 Crown Vic, it's not a modification because the parts added are from a 'sister car', and serves the same fit-finish and function as the original ones. If you replace the fuel pump with an aftermarket replacement that's basically a 'repop' unit designed to function as stock, then it's 'stock'. Turning up your I.P. IS NOT a modification, it's like changing valve lash, it's using whats there and optimizing it. Replacing your road tires with M+S rated tires of equal size when you like 'off pavement' IS NOT a modification as it's a change made to change the functionality of the vehicle to as-factory intent when used in 'adverse conditions' to what the 'OE' was designed to provide.
'Upgrade' might be interchangeable with modified, but it's not as 'major' a change to what was as-factory, meaning adding sealed-beam Halogens to my 76 Ford Torino to replace the factory 'sealed beams' is an upgrade, as it's designed to improve safety and functionality of the lights, adding DTRL to your truck is an upgrade too, running your lights through a relay is another upgrade, as without it, the risk of fire is higher and the relay can handle more current. I usually look at things changed for safety concerns are 'upgrades'. Like adding a redundant brake-light swith, in-case the primary fails. Also, things like LED dome light conversions are 'upgrades'.
'Modified' would be if I took the stock heads off my 390-4BBL 76 F150 and ported them or replaced them with Edelbrock heads. Parts or changes SPECIFICALLY designed to improve the power, function, or form of the original, but NOT including things like tuning your I.P and adjusting your headlights and changing your road tires for M+S tires is a 'modification'.
'Custom' would be stuff like most here have done, projects designed and built to be better than stock or 'what we want', like putting a 6.9 IDI in a 1984 Ford Bronco II or building your F250 into a 'rail rig' with 44" Super Swampers and Dana 70s with 30" of axle articulation and a four-link air suspension.