drupal commerce membership expiration I used this tutorial for creating a membership with Drupal Commerce which works well. 

How I can set membership expiration?

I know I should use Rules, but I do not know how.
If your "membership" is already implemented as a role, you could use the Commerce License module (the Commerce License Role submodule).  In the UI, licenses can be assigned to have default lengths that will automatically be set upon purchase; if you need to change lengths, you can also configure rules to do so.