He was aware.
He wasn't sure (at the time of leaving Frodo) that this really was the One Ring but he had his suspicions and general worries about the ring. He had recently had a very heated discussion about it with Bilbo, witnessing behavior that was uncharacteristic and was definitely worried. He also knew how the ring got to Bilbo and was worried about Bilbo lying about it.
He tells Frodo:
"Keep it secret and keep it safe"
"... odd things may happen to people that have such treasures – if they use them. Let it
be a warning to you to be very careful with it."
I think he left the ring with Frodo despite this for a few reasons:
- Bilbo has had the ring for almost 60 years at this point and was mainly OK. We know that the Ring has a somewhat diminished effect on Hobbits - Gandalf might have considered that.
- The ring was Frodo's and so - that's where it belongs.
Note that he did warn Frodo NOT to use the ring so that no harm should come to him.