Both are great options that serve different purposes. Foam rolling before a workout will increase blood flow to that muscle group (which is ideal for warming up). Foam rolling after a workout will force your muscles into a deep relaxing state. I recommend foam rolling on recovery days (when you have no workout scheduled) to decrease muscle soreness and increase mobility.