Does non-distributed code using licensed code need to be licensed?
For the vast majority of FOSS licenses, the answer is a simple "no." Most FOSS licenses impose no restrictions on non-distributed code whatsoever. The main exception is the GNU Affero General Public License, for which some obligations attach when the software is modified, regardless of whether you distribute it (see section 13 for details).
For non-FOSS (proprietary) licenses, the answer is often "yes," but it must be understood that there are limits to what you can put in a license, FOSS or otherwise. Unfortunately, those limits vary by jurisdiction. The US has a copyright exception under 17 USC 117 which allows "the owner of a copy of a computer program" to run the software, even if that means making a temporary copy in RAM, as well as allowing the creation of backup copies and the making of copies as part of a repair process. However, it's unclear to me whether this applies to cases where a (non-FOSS) EULA says something like "the software is licensed, not sold" - is the end user still the "owner" in that case? Other jurisdictions probably have analogous exceptions, but the details will vary.
This exception likely does apply to most FOSS licenses, but any FOSS license should allow the software to be run without restriction anyway, as this is freedom zero of the four freedoms.
Example: if a company (or a person) uses open-source code with an ISC license (no sublicensing allowed) for an internal app (or a personal project) that isn't shared or sold, should the app be licensed ISC too?
The ISC license is not a copyleft license, so the app does not need to be licensed ISC in any event.