This device does exist although it's not readily available in single unit quantities, its output amplifiers will get in the way and it's very non-linear.
It is a Floating Gate MOSFET, used in Flash memory, EEPRom and the ilk. The programming charge can be variable though somewhat unpredictable as the FN tunnelling (Fowler Nordheim) will be variable across the die. While non-linear it is a proportional effect so you could imagine designing a circuit that linearized the programming effect (of Vth shift). It will be stable over weeks to months so it meets the requirements of hours that you say you'd need.
But a lot depends upon the specifications that you need, how much drift is acceptable etc.
Just to be clear here, I am talking about the individual device/transistor not the complete component as the support circuits of a Flash will prevent you from operating the cells in this way.
Here are 3 references from an EDN article talking about a company called GTronix which was acquired by National Semi (now TI).
Lee, BW, BJ Sheu, and H Yang, “Analog floating-gate synapses for general-purpose VLSI neural computation,” IEEE Transactions on Circuits and Systems, Volume 38, Issue 6, June 1991, pg 654.
Fujita, O, and Y Amemiya, “A floating-gate analog memory device for neural networks,” IEEE Transactions on Electron Devices, Volume 40, Issue 11, November 1993, pg 2029.
Smith, PD, M Kucic, and P Hasler, “Accurate programming of analog floating-gate arrays,” IEEE International Symposium on Circuits and Systems, Volume 5, May 2002, pg V-489.
THere is another class of device that is called a MNOS transistor (Metal Nitride Oxide Semiconductor) in which tehere are two dielectrics in the gate, one of which is Si3N4 which has a lot of traps. This device operates very similarly to the flash cell above.