Culture is required to advance to the next realm. The easiest way to gain culture is to complete tasks. And if you want to earn more culture from luxury resources like silk, silver, dye, pearls, you need to construct a Parade Ground and go capture the resource. With a Market, you will earn even more culture from those resources!
There are several research topics that boost your culture gain.
You lose culture by ending a trade agreement (unless it auto-cancels due to one party advancing to an age where a traded resource is no longer needed) and for attacking someone who you are trade partners with.