Ripples form in sands or other soft deposits by waves or currents. It does not take long - just minutes. But then they get buried and lithified (turned to rock by compaction and cementation) which takes up thousands-millions of years. They are very important in determining the environments under which sediments are deposited and also the sequence of their deposition.