How long should I register a domain name that will be referenced in scientific publications?
If you consider the data of permanent value and essential to your paper, then you should try to preserve it permanently.  The question in that case is not how long to register a domain name for, but rather how to find an organization that's willing to archive the data in the long run.  If you don't have that, then it's going to disappear eventually anyway.  If you do, then you can do whatever you want with the domain name as long as you provide enough information that someone could access the data from the archive even once your domain has expired.

Most scientific publishers solve this problem by archiving supplementary information and data along with the paper.  There are also field-specific data banks.

On the other hand, if this isn't an essential part of your paper (but rather just for illustrative purposes), then you can do whatever you want.