"Only" can be a conjunction, an adverb or an adjective.
It is not correct to end your sentence with a conjunction, but nobody
would ever do that anyway.
- This rule only applies to students
Only can modify "This rule", "applies" or "students" here, depending on the stress.
- This rule applies to students only
Here "only" modifies "students". But (don't throw stones at me) this might be considered to be poor style of English.
- This rule applies only to students
Here "only" also modifies "students". I would suggest this as most correct of the three.
As a conjunction the word "only" is used as follows:
- I'd invite Frances to the party, only (= but I will not because) I
don't want her husband to come.
- I'd call him myself, only (= but I cannot because) I'm at work all
- I'd be happy to do it for you, only (= but) don't expect it to be
done before next week.
- This fabric is similar to wool, only (= except that it is) cheaper.