What is expected if one wants to visit a research lab as a fresh PhD graduate?
Is it okay to e-mail...labs[, after getting a PhD, to ask] if people [I] can visit the lab(s) for about a month? 


Yes. Your email should explain what you want and what you'll provide in return.


  What is expected in return? Do [I] have to give a talk, or produce some result? 


A contribution should be expected from both sides. That contribution might be in the form of research that both sides conduct together, either side learning something from talks or by teaching, and you might be paid.


  Or is it okay to just learn from them, without directly contributing anything?


No. Any visit has to be mutually beneficial.