If I had a lithium polymer battery hooked up to my arduino and a solar panel hooked up to the battery, will it stay on forever? I plan to make small weather station and want to run it like this.
Sounds like a good recipe for setting that LiPo on fire.
Lithium battery chemistry is very unforgiving. You must use a design that prevents not only the overcharging of the LiPo, but also the over-discharging of the LiPo.
There are ICs on the market for just this sort of thing, or you could code it into software in the Arduino. If coding it into the Arduino, use the watchdog feature to make sure your battery management code doesn't get into a bad state and blow up the battery (literally).
If you don't want to deal with battery protection, use lead-acid or NiMH/NiCd batteries.
There are numerous tutorials on how to interface battery storage with solar panels. Most of the weather stations you see advertized have this setup.
Some of them are pretty cheap and even include data storage, wireless connection and processing software. Might be better to just throw some money at it if you are serious about gathering weather data.
Google is your best friend in learning electronics.
Any battery (even lead acid) can be damaged from a solar panel if not controlled.
How much is the maximum voltage of the solar panel? How much wattage?
What size battery?
How much load on the battery (24/7)?
will it stay on forever?
Likely it will not stay on forever.
If the Solar panel is very small, its a lot easier to use NIMH batteries rather than LIPOs.
NIMH are a lot more forgiving about overcharge and undercharge.
If you pick a Solar panel with a maximum current output that is less than C/20
of the Nimh battery, then it will happily accept the overcharge.
3 NIMH in series will give you 3.6 v , almost the same as a lipos 3.7 V
You nor I want to destroy our batteries. I speak from experience. I destroyed large trolling motor batteries, by not having a regulator on the solar panels before. No matter how small the panel, it can happen. If you have the specs for each, you may be able to do some rough calculations, but, if you don't control the charge from the solar to the battery, start saving for new batteries (I learned the hard way).
Give us some more specs.