My doctor just told me until I was comfortable and healed! I didn't tear or anything so I ended up having sex 2 weeks postpartum, but they'll give you the run down on what they recommend while you're in the hospital (:
They want you to wait till your 6 week appt after having baby but I did it at 4 weeks and when I saw my Dr she asked if I had sex I said yeah and she said good .. and asked if I bled or anything went wrong.. so they pretty much just want you to wait till you're healed..